Ticket #10740 (closed defect: worksforme)

Opened 3 years ago

Last modified 3 years ago

NAT + Host-only networking

Reported by: nemonik Owned by:
Priority: major Component: network
Version: VirtualBox 4.1.18 Keywords: host-only, ubuntu precise64
Cc: Guest type: Linux
Host type: Mac OS X


Via "Preferences->Network" I configure a 'vboxnet0' Host-only Network (IPv4 Address:, and IPv4 Network Mask:, 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

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 netmask 0xffffff00 broadcast

I shut off sshd on my host, and then attempt to ssh to, and I cannot ssh in, but from the vm I can ssh to with no problem. If I turn on sshd on my host, and attempt to ssh into, 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...

Change History

comment:1 Changed 3 years ago by Hachiman

  • Status changed from new to closed
  • Resolution set to worksforme

Your configuration isn't looks like you've really desired :). I suppose vboxnet0 with ip: on the host and eth1 with ip: on the guest is what you want.

comment:2 follow-up: ↓ 3 Changed 3 years ago by nemonik

Doh! You're right.

comment:3 in reply to: ↑ 2 Changed 3 years ago by nemonik

Replying to nemonik:

Doh! You're right.

And thank you.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use