Difference between revisions of "Amahi on VirtualBox"
Line 39: | Line 39: | ||
= Altering the VM network config = | = Altering the VM network config = | ||
− | + | At this stage we are going to configure ''two'' network interfaces. Open the VirtualBox network settings window for your VM. Configure the first two adapters thus: | |
* Adapter 1: Enabled, Attached to: Host-only Adapter, Name: vboxnet0 | * Adapter 1: Enabled, Attached to: Host-only Adapter, Name: vboxnet0 | ||
Line 47: | Line 47: | ||
Boot the VM and wait for the login prompt. Login as admin (default password: admin) and use su to become root. Using your favourite editor, create the file: | Boot the VM and wait for the login prompt. Login as admin (default password: admin) and use su to become root. Using your favourite editor, create the file: | ||
− | /etc/sysconfig/network-scripts/ifcfg-eth1 | + | <blockquote><pre>/etc/sysconfig/network-scripts/ifcfg-eth1</pre></blockquote> |
with the contents: | with the contents: | ||
+ | <blockquote> | ||
+ | <pre> | ||
DEVICE=eth1 | DEVICE=eth1 | ||
− | BOOTPROTO=dhcp | + | BOOTPROTO=dhcp |
ONBOOT=yes | ONBOOT=yes | ||
+ | </pre> | ||
+ | </blockquote> | ||
Now we need to reconfigure the hda to ensure that it picks up the new network config, using the command hda-change-gw and the IP address of the host-only network. In my case: | Now we need to reconfigure the hda to ensure that it picks up the new network config, using the command hda-change-gw and the IP address of the host-only network. In my case: | ||
+ | <blockquote> | ||
+ | <pre> | ||
hda-change-gw 192.168.56.1 | hda-change-gw 192.168.56.1 | ||
+ | </pre> | ||
+ | </blockquote> | ||
Now reboot. | Now reboot. |
Revision as of 18:54, 25 October 2010
Contents
Why do this?
If you want to test Amahi without upsetting your existing network configuration, one of the easiest ways of doing so is using a virtual machine. The following description applies to VirtualBox, version 3.2.10. It results in a functioning Amahi install that can be accessed both from the host machine and other VMs, including PXE-booting VM.
Prerequisites
- A working installation of VirtualBox
- An express CD image (this was tested with Amahi-5.4-Express-2.6-Beta-i386.iso)
- A desire to do this!
The catch
The process is fractionally more complex than a standard Amahi install, because we need to tweak the VM network configuration part-way through.
You will also need to know the IP address range that your version of VirtualBox uses for its "Host only" network type. Check the network configuration of the host system on Mac OS (and I expect Linux) there's an interface called "vboxnet0". At the time of writing, the default on Mac OS is 192.168.56.1.
Configure the hda
First, configure your amahi install in the usual way at the control panel. You must use the IP address of the VirtualBox "Host only" interface as your gateway (in my case, 192.168.56.1). If you have already have Amahi on your network, you might wish to consider changing the home domain to something other than home.com.
Make a note of the install code indicated.
Create the VM
Create a fresh VM in the usual VirtualBox way:
- Name it as you see fit ("Amahi-test")
- Select "Linux" and "Fedora" as the OS and version
- Create a virtual disk for the installation: 8GB, dynamically sized should be sufficient
Once you've created the VM, go to the settings window and do the following:
- Check that the first network interface is configured as NAT
- Under storage, attach the Express CD image as a CD
Run the installation
Start your VM and it will boot from the CD image. Work through the installer in the usual way, entering the install code that the amahi control panel gave created earlier. You may be asked to reboot a couple of times during the process. (Note that if you get the initial CD install menu back, you need to disconnect the ISO image and then reboot again.)
Eventually, the console should show a text login prompt. At which point you should shut down the VM (either by sending the shutdown signal from VirtualBox or log in and issue the command).
Altering the VM network config
At this stage we are going to configure two network interfaces. Open the VirtualBox network settings window for your VM. Configure the first two adapters thus:
- Adapter 1: Enabled, Attached to: Host-only Adapter, Name: vboxnet0
- Adapter 2: Enabled, Attached to: NAT
Reconfiguring the system
Boot the VM and wait for the login prompt. Login as admin (default password: admin) and use su to become root. Using your favourite editor, create the file:
/etc/sysconfig/network-scripts/ifcfg-eth1
with the contents:
DEVICE=eth1 BOOTPROTO=dhcp ONBOOT=yes
Now we need to reconfigure the hda to ensure that it picks up the new network config, using the command hda-change-gw and the IP address of the host-only network. In my case:
hda-change-gw 192.168.56.1
Now reboot.
Test it
Wait until the VM comes back up and open a web browser. Browse to http://192.168.56.1/ should put up the usual Amahi log-in page. If not, something's gone wrong. You can also connect via ssh from the host if you don't want to use the VirtualBox console.
Note that the DNS & DHCP will not be visible from the host system unless you alter the host system config. However, other VMs connected to the same host-only network will be able to use these services, including PXE-booting.