VirtualBox host-only static IP connection problemsHow do I setup a virtualbox server with a static ip?Can't...

Why won't the strings command stop?

PTIJ: Should I stay away from my computer?

Create chunks from an array

Caulking a corner instead of taping with joint compound?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Quitting employee has privileged access to critical information

How can neutral atoms have exactly zero electric field when there is a difference in the positions of the charges?

Has Wakanda ever accepted refugees?

I can't die. Who am I?

Reason why dimensional travelling would be restricted

Where is this quote about overcoming the impossible said in "Interstellar"?

Difference between 'stomach' and 'uterus'

Why is it "take a leak?"

Sometimes a banana is just a banana

Specific Chinese carabiner QA?

How do I deal with being envious of my own players?

Can we carry rice to Japan?

Ahoy, Ye Traveler!

Rationale to prefer local variables over instance variables?

Draw bounding region by list of points

Plagiarism of code by other PhD student

It doesn't matter the side you see it

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

Should we avoid writing fiction about historical events without extensive research?



VirtualBox host-only static IP connection problems


How do I setup a virtualbox server with a static ip?Can't set manual IP to Virtualbox Host Only adapter in CentOS 6.5Virtual Box Bridged network w/ Static IP Win7 host Ubuntu GuestHost is not able to ping Guest | Virtual BoxUbuntu virtualbox host connection issuesVirtualBox Host-only adapter port forwardingNo Internet connection in genymotion on VirtualBox 4.3.34Help setting up Malware Analysis home labVirtualBox Host only network don't work Destination Host UnreachableVirtualbox NAT and host-only connectionVirtualBox - can't connect from host to guest (no need of internet)Can't ping VirtualBox (Debian) VM from (macOS) host when a static IP is set













0















I’m using Virtualbox 4.3.30 and I’ve successfully set a virtual machine up with a host-only network to work on DHCP with a non-static IP, but of course, for a virtual machine server, it’s essentially useless. So now, I’m trying to set up a virtual machine Linux server with access to the internet, and a host-only static IP. Host is Windows 8.1, guest is Ubuntu server.



VM config



I have two network devices, one for NAT, and one host-only set to adapter #3. The NAT allows for access to the internet which works. The host-only adapter doesn’t allow the host to access the virtual machine.



VirtualBox config



Host-only adapter #3 has DHCP disabled, an IP of 192.168.50.101, and a netmask of 255.255.255.0.



The VM system



After running:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


…(from here then ifconfig reveals that eth1 (host-only) is connected to the IP address. On the virtual machine, if I do wget 192.168.50.101 it pulls down the default Nginx page on itself. From the host I’m able to ping the static IP address however in the browser, the IP address times out with the message Unable to connect.



Stuff I've tried!



I have also tried editing /etc/network/interfaces from here to no success.



What’s happening here? I’m guessing it can’t be a firewall issue as the host connects when the host-only is using DHCP and I can successfully ping from the host. It also looks like the browser's "cannot connect message" appears in the browser faster than a simple timeout.



Update:



I think I've hit on a bug - if I activate the DHCP in the network only adapter, and set the lower and upper to the same ip address, it seems the browser can all of a sudden allow the network to occur and succeeds.










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Please edit your question: What is your host OS? Also it might help if you could post the actual configuration of /etc/network/interface as well as the actual output of ifconfig.

    – JakeGould
    Oct 9 '15 at 16:38











  • Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0

    – user3791372
    Oct 9 '15 at 16:40













  • What is your host OS? Linux? I understand the guest OS is Linux, but I am still unclear. “It also looks like the cannot connect message appears in the browser faster than a simple timeout.” Fairly irrelevant point. Your web browser is not doing anything more unique than ping. Both items mean the host is not reachable.

    – JakeGould
    Oct 9 '15 at 16:45











  • Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running.

    – user3791372
    Oct 9 '15 at 16:48













  • Okay, then this is an Nginx issue. Are you sure the Nginx config is set for networking and not just localhost connections? But I still feel your IP address settings might be a bigger factor here. Please read my latest edit to my answer.

    – JakeGould
    Oct 9 '15 at 16:59


















0















I’m using Virtualbox 4.3.30 and I’ve successfully set a virtual machine up with a host-only network to work on DHCP with a non-static IP, but of course, for a virtual machine server, it’s essentially useless. So now, I’m trying to set up a virtual machine Linux server with access to the internet, and a host-only static IP. Host is Windows 8.1, guest is Ubuntu server.



VM config



I have two network devices, one for NAT, and one host-only set to adapter #3. The NAT allows for access to the internet which works. The host-only adapter doesn’t allow the host to access the virtual machine.



VirtualBox config



Host-only adapter #3 has DHCP disabled, an IP of 192.168.50.101, and a netmask of 255.255.255.0.



The VM system



After running:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


…(from here then ifconfig reveals that eth1 (host-only) is connected to the IP address. On the virtual machine, if I do wget 192.168.50.101 it pulls down the default Nginx page on itself. From the host I’m able to ping the static IP address however in the browser, the IP address times out with the message Unable to connect.



Stuff I've tried!



I have also tried editing /etc/network/interfaces from here to no success.



What’s happening here? I’m guessing it can’t be a firewall issue as the host connects when the host-only is using DHCP and I can successfully ping from the host. It also looks like the browser's "cannot connect message" appears in the browser faster than a simple timeout.



Update:



I think I've hit on a bug - if I activate the DHCP in the network only adapter, and set the lower and upper to the same ip address, it seems the browser can all of a sudden allow the network to occur and succeeds.










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Please edit your question: What is your host OS? Also it might help if you could post the actual configuration of /etc/network/interface as well as the actual output of ifconfig.

    – JakeGould
    Oct 9 '15 at 16:38











  • Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0

    – user3791372
    Oct 9 '15 at 16:40













  • What is your host OS? Linux? I understand the guest OS is Linux, but I am still unclear. “It also looks like the cannot connect message appears in the browser faster than a simple timeout.” Fairly irrelevant point. Your web browser is not doing anything more unique than ping. Both items mean the host is not reachable.

    – JakeGould
    Oct 9 '15 at 16:45











  • Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running.

    – user3791372
    Oct 9 '15 at 16:48













  • Okay, then this is an Nginx issue. Are you sure the Nginx config is set for networking and not just localhost connections? But I still feel your IP address settings might be a bigger factor here. Please read my latest edit to my answer.

    – JakeGould
    Oct 9 '15 at 16:59
















0












0








0








I’m using Virtualbox 4.3.30 and I’ve successfully set a virtual machine up with a host-only network to work on DHCP with a non-static IP, but of course, for a virtual machine server, it’s essentially useless. So now, I’m trying to set up a virtual machine Linux server with access to the internet, and a host-only static IP. Host is Windows 8.1, guest is Ubuntu server.



VM config



I have two network devices, one for NAT, and one host-only set to adapter #3. The NAT allows for access to the internet which works. The host-only adapter doesn’t allow the host to access the virtual machine.



VirtualBox config



Host-only adapter #3 has DHCP disabled, an IP of 192.168.50.101, and a netmask of 255.255.255.0.



The VM system



After running:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


…(from here then ifconfig reveals that eth1 (host-only) is connected to the IP address. On the virtual machine, if I do wget 192.168.50.101 it pulls down the default Nginx page on itself. From the host I’m able to ping the static IP address however in the browser, the IP address times out with the message Unable to connect.



Stuff I've tried!



I have also tried editing /etc/network/interfaces from here to no success.



What’s happening here? I’m guessing it can’t be a firewall issue as the host connects when the host-only is using DHCP and I can successfully ping from the host. It also looks like the browser's "cannot connect message" appears in the browser faster than a simple timeout.



Update:



I think I've hit on a bug - if I activate the DHCP in the network only adapter, and set the lower and upper to the same ip address, it seems the browser can all of a sudden allow the network to occur and succeeds.










share|improve this question
















I’m using Virtualbox 4.3.30 and I’ve successfully set a virtual machine up with a host-only network to work on DHCP with a non-static IP, but of course, for a virtual machine server, it’s essentially useless. So now, I’m trying to set up a virtual machine Linux server with access to the internet, and a host-only static IP. Host is Windows 8.1, guest is Ubuntu server.



VM config



I have two network devices, one for NAT, and one host-only set to adapter #3. The NAT allows for access to the internet which works. The host-only adapter doesn’t allow the host to access the virtual machine.



VirtualBox config



Host-only adapter #3 has DHCP disabled, an IP of 192.168.50.101, and a netmask of 255.255.255.0.



The VM system



After running:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


…(from here then ifconfig reveals that eth1 (host-only) is connected to the IP address. On the virtual machine, if I do wget 192.168.50.101 it pulls down the default Nginx page on itself. From the host I’m able to ping the static IP address however in the browser, the IP address times out with the message Unable to connect.



Stuff I've tried!



I have also tried editing /etc/network/interfaces from here to no success.



What’s happening here? I’m guessing it can’t be a firewall issue as the host connects when the host-only is using DHCP and I can successfully ping from the host. It also looks like the browser's "cannot connect message" appears in the browser faster than a simple timeout.



Update:



I think I've hit on a bug - if I activate the DHCP in the network only adapter, and set the lower and upper to the same ip address, it seems the browser can all of a sudden allow the network to occur and succeeds.







linux networking virtualbox virtual-machine






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 20 '17 at 10:17









Community

1




1










asked Oct 9 '15 at 16:27









user3791372user3791372

10611




10611





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Please edit your question: What is your host OS? Also it might help if you could post the actual configuration of /etc/network/interface as well as the actual output of ifconfig.

    – JakeGould
    Oct 9 '15 at 16:38











  • Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0

    – user3791372
    Oct 9 '15 at 16:40













  • What is your host OS? Linux? I understand the guest OS is Linux, but I am still unclear. “It also looks like the cannot connect message appears in the browser faster than a simple timeout.” Fairly irrelevant point. Your web browser is not doing anything more unique than ping. Both items mean the host is not reachable.

    – JakeGould
    Oct 9 '15 at 16:45











  • Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running.

    – user3791372
    Oct 9 '15 at 16:48













  • Okay, then this is an Nginx issue. Are you sure the Nginx config is set for networking and not just localhost connections? But I still feel your IP address settings might be a bigger factor here. Please read my latest edit to my answer.

    – JakeGould
    Oct 9 '15 at 16:59





















  • Please edit your question: What is your host OS? Also it might help if you could post the actual configuration of /etc/network/interface as well as the actual output of ifconfig.

    – JakeGould
    Oct 9 '15 at 16:38











  • Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0

    – user3791372
    Oct 9 '15 at 16:40













  • What is your host OS? Linux? I understand the guest OS is Linux, but I am still unclear. “It also looks like the cannot connect message appears in the browser faster than a simple timeout.” Fairly irrelevant point. Your web browser is not doing anything more unique than ping. Both items mean the host is not reachable.

    – JakeGould
    Oct 9 '15 at 16:45











  • Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running.

    – user3791372
    Oct 9 '15 at 16:48













  • Okay, then this is an Nginx issue. Are you sure the Nginx config is set for networking and not just localhost connections? But I still feel your IP address settings might be a bigger factor here. Please read my latest edit to my answer.

    – JakeGould
    Oct 9 '15 at 16:59



















Please edit your question: What is your host OS? Also it might help if you could post the actual configuration of /etc/network/interface as well as the actual output of ifconfig.

– JakeGould
Oct 9 '15 at 16:38





Please edit your question: What is your host OS? Also it might help if you could post the actual configuration of /etc/network/interface as well as the actual output of ifconfig.

– JakeGould
Oct 9 '15 at 16:38













Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0

– user3791372
Oct 9 '15 at 16:40







Host os is specified, I've excluded any config for eth1 (host-only) from /etc/network/interface as that will only make it permanent, the eth1 up code is in the question though, and the relevant line from ifconfig is inet addr: 192.168.50.101 Bcast 192.168.55.255 Mask 255.255.255.0

– user3791372
Oct 9 '15 at 16:40















What is your host OS? Linux? I understand the guest OS is Linux, but I am still unclear. “It also looks like the cannot connect message appears in the browser faster than a simple timeout.” Fairly irrelevant point. Your web browser is not doing anything more unique than ping. Both items mean the host is not reachable.

– JakeGould
Oct 9 '15 at 16:45





What is your host OS? Linux? I understand the guest OS is Linux, but I am still unclear. “It also looks like the cannot connect message appears in the browser faster than a simple timeout.” Fairly irrelevant point. Your web browser is not doing anything more unique than ping. Both items mean the host is not reachable.

– JakeGould
Oct 9 '15 at 16:45













Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running.

– user3791372
Oct 9 '15 at 16:48







Seriously, read the last line of the first paragraph. And like I wrote, ping can successfully ping the guest, but the browser can't reach it, though Nginx is up and succesfully running.

– user3791372
Oct 9 '15 at 16:48















Okay, then this is an Nginx issue. Are you sure the Nginx config is set for networking and not just localhost connections? But I still feel your IP address settings might be a bigger factor here. Please read my latest edit to my answer.

– JakeGould
Oct 9 '15 at 16:59







Okay, then this is an Nginx issue. Are you sure the Nginx config is set for networking and not just localhost connections? But I still feel your IP address settings might be a bigger factor here. Please read my latest edit to my answer.

– JakeGould
Oct 9 '15 at 16:59












1 Answer
1






active

oldest

votes


















0














You state that you set the following:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


From all of my experience using VirtualBox, the guest OS works on a network in the 192.168.56.x range. So I would recommend using this command instead:



sudo ifconfig eth1 192.168.56.10 netmask 255.255.255.0 up


As for why I am choosing 192.168.56.10—instead of 192.168.56.101—in your comment to this answer you stated:




No, I can’t use 192.268.56.x as the default DHCP usually works
within that range so will cause conflicts.




Well, the thing is with a netmask of 255.255.255.0 nothing but the last octet of the address will ever be passed to the larger network on the host. That’s what a netmask is. Further, if you look under “Preferences -> Network” from the VirtualBox application itself and then look under “Host-only Networks”, select that network—should be vboxnet0—and then click the edit icon and look under the DHCP server settings you will find these DHCP server settings:





  • Server Address: 192.168.56.100


  • Server Mask: 255.255.255.0


  • Lower Address Bound: 192.168.56.101


  • Upper Address Bound: 192.168.56.254


Note that DHCP is not taking up the whole range of IPs in 192.168.56.x; it simply starts at 192.168.56.100 for the DHCP server itself and then goes from 192.168.56.101 to 192.168.56.254. Which means IPs in the range of 192.168.56.2 to 192.168.56.99 are free for static use. Note that I left out 192.168.56.1 since that is the VirtualBox router IP address that connects the host OS to the guest OS.



And then to make the change permanent, add a network interface to /etc/network/interfaces like this. Open up the /etc/network/interfaces file:



sudo nano /etc/network/interfaces


And then when all that is tested, done and working as expected you can add—or adjust—the interface details like this:



# The local hostmachine access interface.
auto eth1
iface eth1 inet static
address 192.168.56.100
netmask 255.255.255.0





share|improve this answer


























  • No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

    – user3791372
    Oct 9 '15 at 16:45








  • 1





    @user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

    – JakeGould
    Oct 9 '15 at 16:56











  • Nope, not working

    – user3791372
    Oct 9 '15 at 17:25











  • Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

    – user3791372
    Oct 9 '15 at 18:54










protected by JakeGould Oct 17 '15 at 14:54



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?














1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You state that you set the following:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


From all of my experience using VirtualBox, the guest OS works on a network in the 192.168.56.x range. So I would recommend using this command instead:



sudo ifconfig eth1 192.168.56.10 netmask 255.255.255.0 up


As for why I am choosing 192.168.56.10—instead of 192.168.56.101—in your comment to this answer you stated:




No, I can’t use 192.268.56.x as the default DHCP usually works
within that range so will cause conflicts.




Well, the thing is with a netmask of 255.255.255.0 nothing but the last octet of the address will ever be passed to the larger network on the host. That’s what a netmask is. Further, if you look under “Preferences -> Network” from the VirtualBox application itself and then look under “Host-only Networks”, select that network—should be vboxnet0—and then click the edit icon and look under the DHCP server settings you will find these DHCP server settings:





  • Server Address: 192.168.56.100


  • Server Mask: 255.255.255.0


  • Lower Address Bound: 192.168.56.101


  • Upper Address Bound: 192.168.56.254


Note that DHCP is not taking up the whole range of IPs in 192.168.56.x; it simply starts at 192.168.56.100 for the DHCP server itself and then goes from 192.168.56.101 to 192.168.56.254. Which means IPs in the range of 192.168.56.2 to 192.168.56.99 are free for static use. Note that I left out 192.168.56.1 since that is the VirtualBox router IP address that connects the host OS to the guest OS.



And then to make the change permanent, add a network interface to /etc/network/interfaces like this. Open up the /etc/network/interfaces file:



sudo nano /etc/network/interfaces


And then when all that is tested, done and working as expected you can add—or adjust—the interface details like this:



# The local hostmachine access interface.
auto eth1
iface eth1 inet static
address 192.168.56.100
netmask 255.255.255.0





share|improve this answer


























  • No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

    – user3791372
    Oct 9 '15 at 16:45








  • 1





    @user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

    – JakeGould
    Oct 9 '15 at 16:56











  • Nope, not working

    – user3791372
    Oct 9 '15 at 17:25











  • Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

    – user3791372
    Oct 9 '15 at 18:54
















0














You state that you set the following:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


From all of my experience using VirtualBox, the guest OS works on a network in the 192.168.56.x range. So I would recommend using this command instead:



sudo ifconfig eth1 192.168.56.10 netmask 255.255.255.0 up


As for why I am choosing 192.168.56.10—instead of 192.168.56.101—in your comment to this answer you stated:




No, I can’t use 192.268.56.x as the default DHCP usually works
within that range so will cause conflicts.




Well, the thing is with a netmask of 255.255.255.0 nothing but the last octet of the address will ever be passed to the larger network on the host. That’s what a netmask is. Further, if you look under “Preferences -> Network” from the VirtualBox application itself and then look under “Host-only Networks”, select that network—should be vboxnet0—and then click the edit icon and look under the DHCP server settings you will find these DHCP server settings:





  • Server Address: 192.168.56.100


  • Server Mask: 255.255.255.0


  • Lower Address Bound: 192.168.56.101


  • Upper Address Bound: 192.168.56.254


Note that DHCP is not taking up the whole range of IPs in 192.168.56.x; it simply starts at 192.168.56.100 for the DHCP server itself and then goes from 192.168.56.101 to 192.168.56.254. Which means IPs in the range of 192.168.56.2 to 192.168.56.99 are free for static use. Note that I left out 192.168.56.1 since that is the VirtualBox router IP address that connects the host OS to the guest OS.



And then to make the change permanent, add a network interface to /etc/network/interfaces like this. Open up the /etc/network/interfaces file:



sudo nano /etc/network/interfaces


And then when all that is tested, done and working as expected you can add—or adjust—the interface details like this:



# The local hostmachine access interface.
auto eth1
iface eth1 inet static
address 192.168.56.100
netmask 255.255.255.0





share|improve this answer


























  • No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

    – user3791372
    Oct 9 '15 at 16:45








  • 1





    @user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

    – JakeGould
    Oct 9 '15 at 16:56











  • Nope, not working

    – user3791372
    Oct 9 '15 at 17:25











  • Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

    – user3791372
    Oct 9 '15 at 18:54














0












0








0







You state that you set the following:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


From all of my experience using VirtualBox, the guest OS works on a network in the 192.168.56.x range. So I would recommend using this command instead:



sudo ifconfig eth1 192.168.56.10 netmask 255.255.255.0 up


As for why I am choosing 192.168.56.10—instead of 192.168.56.101—in your comment to this answer you stated:




No, I can’t use 192.268.56.x as the default DHCP usually works
within that range so will cause conflicts.




Well, the thing is with a netmask of 255.255.255.0 nothing but the last octet of the address will ever be passed to the larger network on the host. That’s what a netmask is. Further, if you look under “Preferences -> Network” from the VirtualBox application itself and then look under “Host-only Networks”, select that network—should be vboxnet0—and then click the edit icon and look under the DHCP server settings you will find these DHCP server settings:





  • Server Address: 192.168.56.100


  • Server Mask: 255.255.255.0


  • Lower Address Bound: 192.168.56.101


  • Upper Address Bound: 192.168.56.254


Note that DHCP is not taking up the whole range of IPs in 192.168.56.x; it simply starts at 192.168.56.100 for the DHCP server itself and then goes from 192.168.56.101 to 192.168.56.254. Which means IPs in the range of 192.168.56.2 to 192.168.56.99 are free for static use. Note that I left out 192.168.56.1 since that is the VirtualBox router IP address that connects the host OS to the guest OS.



And then to make the change permanent, add a network interface to /etc/network/interfaces like this. Open up the /etc/network/interfaces file:



sudo nano /etc/network/interfaces


And then when all that is tested, done and working as expected you can add—or adjust—the interface details like this:



# The local hostmachine access interface.
auto eth1
iface eth1 inet static
address 192.168.56.100
netmask 255.255.255.0





share|improve this answer















You state that you set the following:



sudo ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up


From all of my experience using VirtualBox, the guest OS works on a network in the 192.168.56.x range. So I would recommend using this command instead:



sudo ifconfig eth1 192.168.56.10 netmask 255.255.255.0 up


As for why I am choosing 192.168.56.10—instead of 192.168.56.101—in your comment to this answer you stated:




No, I can’t use 192.268.56.x as the default DHCP usually works
within that range so will cause conflicts.




Well, the thing is with a netmask of 255.255.255.0 nothing but the last octet of the address will ever be passed to the larger network on the host. That’s what a netmask is. Further, if you look under “Preferences -> Network” from the VirtualBox application itself and then look under “Host-only Networks”, select that network—should be vboxnet0—and then click the edit icon and look under the DHCP server settings you will find these DHCP server settings:





  • Server Address: 192.168.56.100


  • Server Mask: 255.255.255.0


  • Lower Address Bound: 192.168.56.101


  • Upper Address Bound: 192.168.56.254


Note that DHCP is not taking up the whole range of IPs in 192.168.56.x; it simply starts at 192.168.56.100 for the DHCP server itself and then goes from 192.168.56.101 to 192.168.56.254. Which means IPs in the range of 192.168.56.2 to 192.168.56.99 are free for static use. Note that I left out 192.168.56.1 since that is the VirtualBox router IP address that connects the host OS to the guest OS.



And then to make the change permanent, add a network interface to /etc/network/interfaces like this. Open up the /etc/network/interfaces file:



sudo nano /etc/network/interfaces


And then when all that is tested, done and working as expected you can add—or adjust—the interface details like this:



# The local hostmachine access interface.
auto eth1
iface eth1 inet static
address 192.168.56.100
netmask 255.255.255.0






share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 9 '15 at 17:01

























answered Oct 9 '15 at 16:43









JakeGouldJakeGould

31.7k1097139




31.7k1097139













  • No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

    – user3791372
    Oct 9 '15 at 16:45








  • 1





    @user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

    – JakeGould
    Oct 9 '15 at 16:56











  • Nope, not working

    – user3791372
    Oct 9 '15 at 17:25











  • Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

    – user3791372
    Oct 9 '15 at 18:54



















  • No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

    – user3791372
    Oct 9 '15 at 16:45








  • 1





    @user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

    – JakeGould
    Oct 9 '15 at 16:56











  • Nope, not working

    – user3791372
    Oct 9 '15 at 17:25











  • Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

    – user3791372
    Oct 9 '15 at 18:54

















No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

– user3791372
Oct 9 '15 at 16:45







No, I can't use 192.268.56.xxx as the default DHCP usually works within that range so will cause conflicts, and this is no different to what I already have.

– user3791372
Oct 9 '15 at 16:45






1




1





@user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

– JakeGould
Oct 9 '15 at 16:56





@user3791372 Check my edit to the answer. DHCP is not the full 192.268.56.x range. And the 255.255.255.0 netmask will not allow you to set a subnet other than something in the 192.268.56.x range. Just use an IP from 192.168.56.2 to 192.168.56.99 for a static address and there is no conflict.

– JakeGould
Oct 9 '15 at 16:56













Nope, not working

– user3791372
Oct 9 '15 at 17:25





Nope, not working

– user3791372
Oct 9 '15 at 17:25













Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

– user3791372
Oct 9 '15 at 18:54





Ping responds, on the host, ipconfig shows the network adapter and the correct ip address, on the guest, eth1 is showing the correct inet address, but it's as if windows doesn't connect the virtualbox adapter to the actual machine (so it responds to pings, but nothing else)

– user3791372
Oct 9 '15 at 18:54





protected by JakeGould Oct 17 '15 at 14:54



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?



Popular posts from this blog

VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...