Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
[https://wiki.amahi.org/index.php/Amahi_Virtualized | Back to 'Amahi Virtualized']
This tutorial will not include a detailed description of installing XenServer. That can be found on [http://www.xenserver.org/ 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 a an LVM group that XenServer will use for the creation of VDI 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
<h2>Download XenServer and the Management Console</h2>
<h3>Updates</h3>
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 [http://www.putty.org/ Bitvise WinSSHD] . Then SSH from a client computer into the XenServer. Run 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:# xe patch-upload -s 192.168.1.10 -u root -pw password file-name=/root/XS62E001.xsupdate
{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code|-|{{#tag:syntaxhighlight|​{{{Code|xe patch-upload -s 192.168.1.10 -u root -pw password file-name=/root/XS62E001.xsupdate}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}-->  The IP is here should be the one set for the XenServer and the filename is the one that matches 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:{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code|-|{{#tag:syntaxhighlight|​{{{Code|xe -s 192.168.1.10 -u root -pw password patch-pool-apply uuid=dedcc0dd-d8f3-4f76-90ca-92697c7a44f0}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
Now apply the hotfix:
# xe -s 192.168.1.10 -u root -pw password patch-pool-apply uuid=dedcc0dd-d8f3-4f76-90ca-92697c7a44f0
Verify patch installation:
{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: # aaa"!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code|-|{{#tag:syntaxhighlight|​{{{Code|xe patch-list -s 192.168.1.10 -u root -pw password name-label=XS62E001}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}--> 
If everything looks good then run this command to restart server:
{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code|-|{{# tag:syntaxhighlight|​{{{Code|xe-toolstack-restart}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
Windows <h2>Amahi (Linux) Setup</h2>installed with Create a New VM, then choose <b>Other install Media Template</b>. 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 and 320 GB HD. Installed from Windows 7 x64 DVD in the Now add a virtual disk. For better performance you should have a separate drive or drivepool for each VM you create. Then installed XenServer Tools by choosing To start, create a 500 GB or larger VDI and move on to the xs-toolsnetwork setup. Again, for better performance, choose a dedicated NIC for each VM.iso from For this tutorial, you can just choose the DVD Drive 1 menudefaults which is a shared NIC on your XenServer. Done!
Amahi (Linux) SetupCreate a New VM, then choose Other install Media Template. Name the machine without spaces, choose Switch to install from DVD drive where you have the Amahi 7.1 express disk located. Place on your Xenserver and choose CPU and RAM. I recommend a minimum of 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. I just created a new VDI on a disk I use for a variety of VMs and 750 GB. Again, for better performance, choose a dedicated NIC for each VM. I just chose the defaults which is a shared NIC on my XenServer. Switch to console tab on the newly created VM and install Amahi 7.1 as per [http://docs.amahi.org/ instructions] (ensure you have your code and that you would likelet it reboot twice before initializing in browser).
One suggested change from the default Amahi install is to <b>make is the boot partition needs to be ext3Ext3</b>. 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 anyway, then you’ll have to you could create a /boot partition in Ext3 and the / partition in Ext4. Finish the Amahi install as per instructions.
CodeIf you are happy with a simple setup and not too concerned about performance then you could stop here and skip to the part about <b>installing Xen-Tools below</b>. The guest VM with Amahi installed on it is in <i>HVM mode or hardware assisted virtualization</i> (more information [http:4M86YN5//en.wikipedia.org/wiki/Xen here]). If you would like your guest VM to run in <i>paravirtualization mode</i>, which will give better performance and access to more than three drives, you need to complete the next part.
After reboot. SSH in and execute this command;
# yum -y update openssl
<h3>Convert to PV or Paravitualize Tips from: https:<//www.cetic.be/Paravirtualize-an-Ubuntu-VM-usingh3>
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.
Copy First you should copy down the defaults from grub2 on the Amahi VM. Go to /boot/grub2 and read grub.cfg. Need:
{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"
!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code
|-
|{{#tag:syntaxhighlight|​{{{Code|vi /boot/grub2/grub.cfg}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}
|}
<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
 
 
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:
 
<pre>
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
</pre>
 
You also need the path for initrd. It might look like this:
<pre>
initrd /boot/initramfs-3.10.5-201.fc19.x86_64.img
</pre>
 
Then SSH in to the XenServer host and identify the name of the VM you wish to convert to PV mode.
 
{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"
!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code
|-
|{{#tag:syntaxhighlight|​{{{Code|xe vm-list}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}
|}
<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
 
 
You will need the name of the VM not the UUID. Now download the [https://www.cetic.be/IMG/zip/makepv.sh.zip makepv.sh] script.
 
{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"
!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code
|-
|{{#tag:syntaxhighlight|​{{{Code|wget https://www.cetic.be/IMG/zip/makepv.sh.zip
unzip makepv.sh.zip}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}
|}
<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
 
 
This script will:
<ul>
<li>change the bootloader from HVM to PV mode
<li>prompt for kernel path <i>(/boot/vmlinuz-3.10.5-201.fc19.x86_64)</i>
<li>prompt for kernel parameters <i>(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)</i>
<li>prompt for initrd path <i>(/boot/initramfs-3.10.5-201.fc19.x86_64.img)</i>
<li>convert VM hard drive
</ul>
 
 
Once you have the script downloaded and unpacked make it executable and run it.
Then ssh on the XenServer host and identify the {|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code|-|{{#tag:syntaxhighlight|​{{{Code|chmod +x makepv.sh./makepv.sh <vm name of the VM you wish to convert to PV mode.>}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
xe vm-list
need <h3>Install XenServer Tools for linux</h3>First Use XenCenter Management console to insert the name of <i>xs-tools.iso</i> in the DVD drive. Then SSH into the Amahi VM (Amahi71, <b>the console tab may not uuid=c5ab2d09-9669-fcb5-f121-c979092dff91work until these tools are installed</b>), and execute the following commands.
download the makepvIf you kept your guest VM in <b>HVM mode</b>:{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #aaa"!style="color:#777; background-color:#dfd;text-align:left"|{{{lang|{{{2|bash}}}}}} code|-|{{#tag:syntaxhighlight|​{{{Code|mkdir /mnt/xs-toolsmount /dev/cdrom /mnt/xs-tools/mnt/xs-tools/Linux/install.sh.reboot}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}-->
wget https://www.cetic.be/IMG/zip/makepv.sh.zip
unzip makepv.sh.zip
It will:change the bootloader from HVM to If you converted your guest VM into <b>PV mode</b>;prompt for kernel path (/boot/vmlinuz{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-3.10.5style: solid; border-201.fc19.x86_64),color: #aaa"prompt for kernel parameters (root!style=UUID=42e4c7e4"color:#777; background-f260color:#dfd;text-4462align:left"|{{{lang|{{{2|bash}}}}}} code|-ad9c|{{#tag:syntaxhighlight|​{{{Code|mkdir /mnt/xs-toolsmount /dev/disk/by-c3f375e3a967 ro rd.md=0 rd.lvm=0 rd.dm=0 vconsole.keymap=us rd.luks=0 vconsole.font=latarcyrheblabel/XenServer\\x20Tools /mnt/xs-sun16 rhgb quiettools/)prompt for initrd path (/bootmnt/initramfsxs-3tools/Linux/install.10.5shreboot}}}​|lang={{{lang|{{{2|bash}}}}}}|enclose=none}}|}<!--{{#tag:syntaxhighlight|{{{1}}}}}--201.fc19.x86_64.img)convert VM hard drive>
chmod +x makepv.sh
./makepv.sh <vm name>
<hr>
<h2>Links or Sources that helped create this tutorial</h2>
<ul>
<li>XenServer setup:http://www.dbarticles.com/xen-server-6-2-installation-setup-and-setup-first-centos-6-x86_64-virtual-server/ </li>
<li>XenServer download:http://www.xenserver.org/open-source-virtualization-download.html</li>
<li>Paravirtualization: https://www.cetic.be/Paravirtualize-an-Ubuntu-VM-using</li>
<li>OpenXenManager: http://sourceforge.net/projects/openxenmanager/</li>
<li>Install OpenXenManager: http://xmodulo.com/2013/01/how-to-install-xencenter-on-linux.html</li>
</ul>
Install XenServer Tools for linux
First Use XenCenter to insert the xs-tools.iso in the DVD drive
Then SSH into the Amahi VM (the console will not work until these tools are installed);
# mkdir <i>Note: if you are having trouble reaching your apps from the dashboard, you may need to run this command on the HDA:</mnt/xsi>{|style="width: 95%; margin-left: 10px; border-collapse: collapse; border-width: 1px; border-style: solid; border-toolscolor: #aaa"!style="color:# mount /dev/cdrom /mnt/xs777; background-color:#dfd;text-toolsalign:left"|{{{lang|{{{2|bash}}}}}} codeor mount /dev/disk/by|-label/XenServer\\x20Tools /mnt/xs-tools/)|{{# tag:syntaxhighlight|​{{{Code|yum -y update openssl}}}​|lang={{{lang|{{{2|bash /mnt/xs}}}}}}|enclose=none}}|}<!--tools/Linux/install.sh{{# reboottag:syntaxhighlight|{{{1}}}}}-->