Wednesday, April 27, 2011

Connecting a VirtualBox guest network to its host

I love VirtualBox (http://www.virtualbox.org/) and use it all the time.  I have a Ubuntu guest running on an OSX host.  I wanted to move files between the two, but my OSX home directory is encrypted (as they all should be).  In general, the network connection made from the guest to outside the box isn't directly available, so I added a second network adapter via the VirtualBox control panel, and made it a "Host-only Adapter" (see screen shot below).  An 'ifconfig' on the guest gave the address of 192.168.56.101, so a simple 'sftp beaty@192.168.56.101' from the host OS connected me to the SSHD server.
One does have to first create the network via Virtualbox's preferences:
 

No comments: