Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 4

Exposing the Server by Les Richardson

From the following URL on sitepoint:


http://www.sitepoint.com/blogs/2009/10/27/build-your-own-dev-server-with-virtualbox/

With the following lines to post into your xml configuration file (location outlined in the article)
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort"
value="2222"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort"
value="22"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol"
value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort"
value="8888"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort"
value="80"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol"
value="TCP"/>

You can change the '222' host port value to the normal 22 if desired. Similarly change the hostport to 80
from 8888 for http values.

Importing and Configuring OpenAdmin in VirtualBox© - by Andy Figueroa

These steps were taken while running VirtualBox© 3.1.2 on my virtual host test server. Any
reasonably up-to-date version will do as long as it's version 3.something.

Don't change the filename of the downloaded vmdk file because that filename is also embedded in the
ovf file, and import won't work unless it can find the vmdk.

Once you import and start the new virtual OpenAdmin, login as root.

As issued, the root password is set as “openadmin” with one user:


username: tech
password: abc123

Configure Networking

You should run 'ifconfig' to see if you have networking established. If you only see the loopback
interface 'lo', you may need to check and see where your network interface is.

dmesg | grep eth

will show you if your interfaces is at eth0 or has been reassigned (renamed) during booting.
In my case, I had to rename eth0 to eth1 in the file /etc/network/interfaces then restart the network.

nano /etc/network/interfaces

making the necessary edits, then restart networking with:

/etc/init.d/networking restart

The interfaces file is well documented on the web.

The right format for giving your inteface a static IP of 192.168.1.70 where your router is at the gateway
address of 192.168.1.1 is:

auto eth1
iface eth1 inet static
address 192.168.1.70
netmask 255.255.255.0
gateway 192.168.1.1

To use a static IP, you also need to change the network configuration in the VirtualBox settings on the
host for this virtual machine to “Bridged Adapter” and select the address for your host computer's
network card in the drop down menu.

Mouse Copy and paste in the openadmin/linux command line

Without a gui the mouse is worthless for copying and pasting which I use a lot, so gpm (apt-get install
gpm) is helpful. But, you get copy and paste by accessing the installed guest from another computer via
ssh.

MS Windows SSH

If you are using a Windows host, Windows does not come with an ssh client (needed to access the
guest shell over the network. I am familiar with and have used PuTTY, which is an adequate, free, ssh
client. Install and configure PuTTY or your choice of alternatives. PuTTY can be downloaded from:
http://www.chiark.greenend.org.uk/~sgtatham/putty/

Installing Guest Additions


(assumes a Linux host but mostly applies for Windows host also):
There are no guest additions running, as the guest additions need to match your VirtualBox host
version. You need to these to share directories and files with the host computer. If this isn't important
to you, you can skip this section entirely. To build the guest additions modules, you need to install the
kernel headers using:

apt-get install linux-headers-$(uname -r)

Then, extract the file VBoxLinuxAdditions-x86.run from VBoxGuestAdditions.iso on the host


computer. To do that mount the iso, enter it, and transfer the file to the guest (using sftp).

On an Debian-based (i.e. Ubuntu) host the gust additions file is found in /usr/share/virtualbox
On a Gentoo host the file is at: /opt/VirtualBox/additions/

If you are on a Windows computer and can't figure this out yourself, see the last item “TODO” after
this section.

To mount the iso, use:

mkdir /mnt/iso
mount -o loop VBoxGuestAdditions.iso /mnt/iso
cd /mnt/iso
sftp tech@address_of_virtual_openadmin_server (enter password abc123)
put VBoxLinuxAdditions-x86.run
bye

Once the VBoxLinuxAdditions-x86.run is on the guest, run it with ./VBoxLinuxAdditions-x86.run

Then one can share a directory shared from the host.

From the VirtualBox settings screen with the OpenAdmin virtual machine powered off, share a
directory such as /home/vbox and give it the name vbox.

Power up the guest, then, in the guest fstab, add the entry for this shared directory as follows:

mkdir /mnt/vbox
nano /etc/fstab
vbox /mnt/vbox vboxfs uid:username 00

then this directory will be automatically mounted at boot time and you will be able to copy files to and
from the host machine from within the guest machine.

The reason for the uid: entry is for permissions. Change “username” to the actual username of the
owner of the directory /home/vbox on the host computer. I DO NOT KNOW how this aspect of
sharing works with a Windows host.

Each time you upgrade VirtualBox, you should also upgrade any installed guest additions. If not,
eventually some things will break.

To Do

Installing the guest additions from a Windows host computer VirtualBox installation. In the meantime,
you can download guest additions files from: http://download.virtualbox.org/virtualbox/ directoy to
your new OpenAdmin virtual machine using the shell command:
http://download.virtualbox.org/virtualbox/3.1.2/VBoxGuestAdditions_3.1.2.iso

Questions may be directed to:


figueroa@andyfigueroa.us

You might also like