VirtualBox
From HerzbubeWiki
References
Online help on Mac OS X opens the following PDF document, which contains a very useful reference:
/Applications/VirtualBox.app/Contents/MacOS/UserManual.pdf
Networking between Mac OS X / Linux Guest while host is offline
Host offline = Host is not connected to any external network.
Configure Mac OS X with a static IP address:
- Launch "System Preferences.app" and open the "Network" preference pane
- Create a new environment called "static"
- Select the "Ethernet (integrated)" service
- Set the configuration mode to "Manual"
- IP Address = 192.168.1.8
- Subnet mask = 255.255.255.255 (not the usual 255.255.255.0, because that would require an external gateway, i.e. router, which we don't have since the host is offline)
- Leave "Router", "DNS Server" and "Search domains" empty
Configure the Linux guest (e.g. "debian-lenny") in the GUI as follows:
- Edit the guest machine
- On the "Network" tab, enable Adapter 1
- Adapter Type must be one of the PCnet types (otherwise the command line configuration below will not work)
- Attached to = NAT (for the host it will appear as if VirtualBox.app is the originator of all networking requests)
Configure the Linux guest on the command line as follows (information taken from the VirtualBox user manual PDF document):
# SSH /Applications/VirtualBox.app//Contents/MacOS/VBoxManage setextradata debian-lenny "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP /Applications/VirtualBox.app//Contents/MacOS/VBoxManage setextradata debian-lenny "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22 /Applications/VirtualBox.app//Contents/MacOS/VBoxManage setextradata debian-lenny "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222 # HTTP /Applications/VirtualBox.app//Contents/MacOS/VBoxManage setextradata debian-lenny "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP /Applications/VirtualBox.app//Contents/MacOS/VBoxManage setextradata debian-lenny "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 80 /Applications/VirtualBox.app//Contents/MacOS/VBoxManage setextradata debian-lenny "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 8080
Note:
- Command line configuration is possible only while the guest is stopped
- Host ports must be >1000; Mac OS X requires root access for ports <=1000
