How to run Virtual Machine Image on VirtualBox

Quick instructions if you know how to use VirtualBox:
  • Create a new VirtualBox virtual machine of type Linux/Debian, using the existing image you downloaded (the .vmdk one)
  • For the network, either use "NAT" and configure port forwarding, or use "Host Interface" (see below).
  • Run the newly created VM.

Installation

Download VirtualBox and install it through the graphical installer. This should be very easy.

Adding the VM image

Adding the Virtual Machine

vbss1.png Create a new virtual machine named "foswiki" (you can choose any name of course), of type Linux, kind Debian
vbss2.png Click on the "Existing..." button to make it use an existing image
vbss3.png Select the foswiki-vm.vmdk you extracted from the archive (you will have to click the "Add" button to add it to your list of available images first)
vbss4.png Your VM is now ready, click "Finish"
vbss5.png And is ready to start. You can see that by default we are in "Option 1: NAT" in the "Network" field at the bottom right

Now, for the network, you have 2 options (see below)

Option 1: NAT + Port-forwarding (default)

By default, the network interface is set to use NAT.

Afterwards (while the VM is not running), you should activate port forwarding by typing some commands (as the user running VirtualBox) as follows:

VBoxManage is installed with VirtualBox. If you don't install on C:, it won't be in the path. In the shell, cd to the directory containing VBoxManage and execute the command there.
VBoxManage setextradata "foswiki-1.0" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/foswiki/Protocol" TCP
VBoxManage setextradata "foswiki-1.0" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/foswiki/GuestPort" 80
VBoxManage setextradata "foswiki-1.0" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/foswiki/HostPort" 8888
(Here, "foswiki" is the name you gave your VM, and 8888 is the port you want to use on your host--just enter http://localhost:8888 in your browser after you see the login prompt in your VM)
It should look like this:

Option 2: Host Interface

vbss6.png Click the blue "Network" at the bottom right to setup the network to use "Host Interface"
vbss7.png Start the VM. In its console, log as root (password is foswiki, attention : english qwerty keymap), and type ifconfig. The first listed "inet addr" under an eth (eth0 normally) entry is the IP address of your foswiki server (in the screenshot it is 10.0.0.62 but will depend on your network).
vbss8.png Use this IP address in your browser to browse your foswiki server (in the screenshot it means going to http://10.0.0.62)

Troubleshooting

  • The system blocks with a message "Waiting for root file system"
    • Try to declare the virtual emulated disk as a SATA Port 0 (this should not be needed normally)
  • The server do not respond
    • Log in the VM console (user: root, password: foswiki, attention : english qwerty keymap), type:
      /bin/echo "" >/etc/udev/rules.d/z25_persistent-net.rules
      and restart the VM. This is in case you changed many times the network options and the eth number changed too much.
  • If you get the error *"Failed to open/create the internal network" . Do the following steps
    • Edit the machine, go to the network tab
    • Check that the Attached To is set to NAT
Topic revision: r19 - 01 Jul 2011 - 15:34:40 - OliverKrueger
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads