#10740 closed defect (worksforme)
NAT + Host-only networking
Reported by: | nemonik | Owned by: | |
---|---|---|---|
Component: | network | Version: | VirtualBox 4.1.18 |
Keywords: | host-only, ubuntu precise64 | Cc: | |
Guest type: | Linux | Host type: | Mac OS X |
Description
Via "Preferences->Network" I configure a 'vboxnet0' Host-only Network (IPv4 Address: 10.42.0.6, and IPv4 Network Mask: 255.255.255.0, IPv6 Network MAsk Length:0), then create a guest VM with two adapters: adapter 1 (NAT), and Adpater 2 (Host-only adapter, 'vboxnet0'). I install ubuntu-12.04-server-amd64.iso, and once up configure /etc/network/interfaces like so:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet static address 10.42.0.6 netmask 255.255.255.0
Back to the cmd-line execute:
ifup eth1
All the VMs interfaces are up including the host-only adapter
Running ifconfig on the host returns:
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 0a:00:27:00:00:00 inet 10.42.0.6 netmask 0xffffff00 broadcast 10.42.0.255
I shut off sshd on my host, and then attempt to ssh to 10.42.0.6, and I cannot ssh in, but from the vm I can ssh to 10.42.0.6 with no problem. If I turn on sshd on my host, and attempt to ssh into 10.42.0.6, I instead appear to be connecting to the host, and not the guest vm.
I'd like the VM to have access to the Internet via the NAT adapter, and be able to access the VM via the host-only adapter, and this isn't happening.
I script uninstalled VirtualBox, cleaned up my account's /Library of all VirtualBox references and went through the same config after rebooting and met w/ the same results...
Your configuration isn't looks like you've really desired :). I suppose vboxnet0 with ip: 10.42.0.1 on the host and eth1 with ip: 10.42.0.6 on the guest is what you want.