domingo, 23 de agosto de 2015

Instalar Xen 4.1 no Debian Wheezy 7.0


I added an installation script on my github account if anyone is interested 
https://github.com/Midacts/Xen

After installing Debian Wheezy, log in as root and install these packages:
apt-get install xen-linux-system-amd64 xen-tools xen-utils-4.1 xen-hypervisor-4.1-amd64
Xen 4.1 is the most 'up to date' version of Xen you can install without compiling from source. If you compile from source, you can get the most bleeding edge version of Xen, but it can not be updated with 'apt-get upgrade'.

Next, change the boot order of xen, so that your machine will automatically boot Xen first:
mv /etc/grub.d/20_linux_xen /etc/grub.d/09_linux_xen
Now we need to edit '/etc/default/grub' so Xen will now use all of our RAM! This way we set the max amount our Xen box will consume, so our DomU's have some to use too. Add this to the end of the file:
GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=512M"
Now you can reboot, and xen will be automatically selected and automatically booted for you. you can check this is you see the xen directory in the /proc directory (/proc/xen).

Now to get our start setting up Xen so that it can run virt-manager. If not, then when we go to run virt-manager, it will throw errors. open '/etc/xen/xend-config.sxp' and edit these lines to look like this:
(xend-http-server yes)
(xend-unix-server yes)
(xend-tcp-xmlrpc-server yes)
(xend-unix-xmlrpc-server yes)
(dom0-min-mem 512)
(enable-dom0-ballooning no)
Now update grub and reboot for all these changes to take affect, and to boot into Xen:
update-grub
Install virt-manager. This will give us a GUI to manage our xen hypervisor and its Domu's:
apt-get install virt-manager
Edit the network settings (/etc/network/interfaces). I like to used bridged mode, there are several other options, this is the best and easiest way:
auto lo
iface lo inet loopback

iface eth0 inet manual
auto xenbr0

iface xenbr0 inet static
        bridge_ports eth0
        address 192.168.1.xxx
        netmask 255.255.255.0
        gateway 192.168.1.1
Then run a 'service networking restart' to make these changes go through.

While we are here, i like to set up my wake on lan, so go ahead and install ethtool:
apt-get install ethtool
Then add  thisto the end of the '/etc/network/interfaces' file in order to enable WOL capabilities to your machine:

'ethernet-wol g'

SUMMARY

That's it! We have a working xen hypervisor that is up and ready to start having Domu's added to it.


I hope this can help somebody else out as my as it helped me. If you have any questions please leave me a message below. The best resources I had, besides Google, was the ##xen IRC channels on freenode. It is pretty dead, but sometimes you can glean some good info from the guys there.

Thanks again!

Autor: John McCarthy

Nenhum comentário: