Install Debian Squeeze
- Install Debian Squeeze 6.0.4 into VirtualBox
- Login as root.
- Run
apt-get update apt-get upgrade
VirtualBox Guest Additions
- Install
bzip2
, if not present:apt-get install bzip2
- Install
dkms
, if not already presentapt-get install dkms
Install Guest Host Additions from Virtual Box GUI Menu in host.
- Mount CD-ROM from Debian shell
mount -t iso9660 /dev/cdrom /media/cdrom0
- Execute Guest Additions installer:
cd /media/cdrom ./VboxLinuxAdditions.run
- Restart the system
shutdown -r now
Install sshd
- Run
apt-get install ssh
Shutdown the system, we will reconfigure VirtualBox settings now.
Reconfigure VirtualBox Network Settings [Single-Adapter Solution]
This solution is easy to setup, but when your IP address changes frequently (e. g. while migrating between various networks) your hosted system IP will change as well.
In Settings, change Network settings. Switch Adapter 1 from NAT to Bridged Adapter and pick your default Network Card.
- Start Debian anew. Then check network settings:
ifconfig
You should see the acquired IP in the same network as your host computer.
- Make note of the IP address from
ifconfig
(seeinet addr
). For exampleinet addr:192.168.1.101
- From host system, try:
ping 192.168.1.101
Test the connection from Putty.
Reconfigure VirtualBox Network Settings [Two-Adapter Solution]
This solution is a little bit more complicated to set-up, however, it is better when you frequently migrate between multiple networks.
Switch off the Debian.
In Settings, change Network settings. Switch Adapter 1 from NAT to Host Only and pick VirtualBox Ethernet Adapter.
On the Adapter 2 tab, enable the second adapter and switch it to NAT mode.
Start Debian anew. You will see that outbound network connection will be disabled, in other words, you won’t be able to connect from Debian to the outside network. Luckily, this is only a temporary situation.
- View the
/etc/network/interfaces
file and edit it.nano /etc/network/interfaces
- Add the following lines
# The secondary network interface allow-hotplug eth1 iface eth1 inet dhcp
- Start the
eth1
network adapter (corresponding to Adapter 2)ifup eth1
- Try to ping www.google.com
ping www.google.com