Amahi in Xenserver without Greyhole

From Amahi Wiki
Jump to: navigation, search

Back to 'Amahi Virtualized'

This tutorial will not include a detailed description of installing XenServer. That can be found on XenServer.org.

Similar to other Virtualization tutorials, keep in mind that the install of XenServer will erase all data and drives connected to the local machine during the installation. The drives will become part of an LVM group that XenServer will use for the creation of all VDIs and guest VM containers. It is recommended that you disconnect all drives but one during this first setup. Later you can add drives and attempt more advance configurations, like greyhole for your Amahi VM. For now, this tutorial sets up a simple install of XenServer and one VM running Amahi 7.1

Download XenServer and the Management Console

Download the server and the console from: http://www.xenserver.org/open-source-virtualization-download.html

Download the installation ISO and burn to a CD. Make sure virtual extensions for the CPU are turned on in the BIOS. Boot the machine that will be the server with only one hard drive attached. Choose all the defaults and do not install any supplemental packs. Setup a root password and set an IP, Gateway, and DNS that would work when your HDA is off (since that will be your DHCP and DNS on your network once it is running).

Download the XenCenter Windows Management Console on a Microsoft Windows client computer and install. Connect it to the newly set up XenServer using the the IP you setup during the server install. You could also try using OpenXenManager which runs on Linux, but Citrix only supports XenCenter running on Windows.

Updates

Put the server into Maintenance Mode. Download the updates suggested from the XenCenter on a client machine. Use SCP to copy the downloaded update file to a location you can find on the XenCenter server or on Windows use an SCP program like Bitvise WinSSHD . Then SSH from a client computer into the XenServer. For each of the following commands use the user 'root' and the password you setup during the installation of your XenServer. Start by running the following at the command prompt:

bash code
​xe patch-upload -s 192.168.1.10 -u root -pw password file-name=/root/XS62E001.xsupdate​


The IP here should be the one set for the XenServer and the filename should match the update that was just downloaded and unzipped. If uploaded properly you should get a UUID, example: dedcc0dd-d8f3-4f76-90ca-92697c7a44f0

Now apply the hotfix using the confirmation UUID:

bash code
​xe -s 192.168.1.10 -u root -pw password patch-pool-apply uuid=dedcc0dd-d8f3-4f76-90ca-92697c7a44f0​


Verify patch installation:

bash code
​xe patch-list -s 192.168.1.10 -u root -pw password name-label=XS62E001​


If everything looks good then run this command to restart server:

bash code
​xe-toolstack-restart​


Amahi (Linux) Setup

Create a New VM, then choose Other install Media Template. Name the machine without spaces, choose to install from DVD drive where you have the Amahi 7.1 express disk located. Place on your XenServer and choose CPU and RAM. A recommended minimum would be 1 CPU, 2048 MB RAM. Now add a virtual disk. For better performance you should have a separate drive or drive pool for each VM you create. To start, create a 500 GB or larger VDI and move on to the network setup. Again, for better performance, choose a dedicated NIC for each VM. For this tutorial, you can just choose the defaults which is a shared NIC on your XenServer.

Switch to the console tab on the newly created VM and install Amahi 7.1 as per instructions (ensure you have your code and that you let it reboot twice before initializing in browser).

One suggested change from the default Amahi install is to make the boot partition Ext3. While partitioning the hard drive, choose Ext3 rather than Ext4, because ’pygrub’, the XenServer bootloader for the PV mode, can’t read Ext4. If you wish to benefit from Ext4 advantages you could create a /boot partition in Ext3 and the / partition in Ext4.

If you are happy with a simple setup and not too concerned about performance then you could stop here and skip to the part about installing Xen-Tools below. The guest VM with Amahi installed on it is in HVM mode or hardware assisted virtualization (more information here). If you would like your guest VM to run in paravirtualization mode, which will give better performance and access to more than three drives, you need to complete the next part.


Convert to PV or Paravitualize

You only need to do this for slightly better resource management, like attaching more than three VDI images. This is only possible if your boot partition is EXT3.

First you should copy down the defaults from grub2 on the Amahi VM. Go to /boot/grub2 and read grub.cfg.

bash code
​vi /boot/grub2/grub.cfg​


What you are looking for is the line that specifies your default linux boot option. Both the location and all of the kernel options. It might look like this:

linux   /boot/vmlinuz-3.10.5-201.fc19.x86_64 root=UUID=42e4c7e4-f260-4462-ad9c-c3f375e3a967 ro rd.md=0 rd.lvm=0 rd.dm=0 vconsole.keymap=us  rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet

You also need the path for initrd. It might look like this:

initrd  /boot/initramfs-3.10.5-201.fc19.x86_64.img

Then SSH in to the XenServer host and identify the name of the VM you wish to convert to PV mode.

bash code
​xe vm-list​


You will need the name of the VM not the UUID. Now download the makepv.sh script.

bash code
​wget https://www.cetic.be/IMG/zip/makepv.sh.zip unzip makepv.sh.zip​


This script will:

  • change the bootloader from HVM to PV mode
  • prompt for kernel path (/boot/vmlinuz-3.10.5-201.fc19.x86_64)
  • prompt for kernel parameters (root=UUID=42e4c7e4-f260-4462-ad9c-c3f375e3a967 ro rd.md=0 rd.lvm=0 rd.dm=0 vconsole.keymap=us rd.luks=0 vconsole.font=latarcyrheb-sun16 rhgb quiet)
  • prompt for initrd path (/boot/initramfs-3.10.5-201.fc19.x86_64.img)
  • convert VM hard drive


Once you have the script downloaded and unpacked make it executable and run it.

bash code
​chmod +x makepv.sh ./makepv.sh <vm name>​


Install XenServer Tools for linux

First Use XenCenter Management console to insert the xs-tools.iso in the DVD drive. Then SSH into the Amahi VM (the console tab may not work until these tools are installed), and execute the following commands.

If you kept your guest VM in HVM mode:

bash code
​mkdir /mnt/xs-tools mount /dev/cdrom /mnt/xs-tools /mnt/xs-tools/Linux/install.sh reboot​


If you converted your guest VM into PV mode;

bash code
​mkdir /mnt/xs-tools mount /dev/disk/by-label/XenServer\\x20Tools /mnt/xs-tools/) /mnt/xs-tools/Linux/install.sh reboot​



Links or Sources that helped create this tutorial


Note: if you are having trouble reaching your apps from the dashboard, you may need to run this command on the HDA:

bash code
​yum -y update openssl​