A quick note, there are actually 3 modes, not two when it comes to the drivers in use:
- HVM: unmodified kernel and drivers using software emulated devices
- PV-HVM: unmodified kernel with paravirtualized (Xen specific) disk and network drivers
- PV: modified kernel and drivers
For a Xen guest/DomU you can do a very basic
uname
andlsmod
with a grep to list the modules in use:uname -a lsmod | grep xen
If
uname -a
lists a kernel with the string "xen" in it, then you have a modified kernel and it's likely a PV guest, and you will see output from thelsmod
command to confirm it. If you have output from the grep onlsmod
but no sign of a modified kernel then you are PV-HVM. Without any sign of either, it's a straight HVM.Note: Generally you can do more with VMs that have the PV tools installed, so that can be quite an obvious pointer, however you can fake the presence of the PV tools to allow suspend/resume etc. so you cannot rely on that in general.
...
Introduction to Xen: http://wiki.xenproject.org/wiki/Xen_Beginners_Guide#What_is_this_Xen_Project_software_all_about.3F
Installation (host/dom0)
TODO: is xen-docs useful (probably not; installed hoping for an xl man page)?
aptitude install xen-docs-4.1 xen-linux-system
Adjust grub so the default boot item is Xen (ref: https://xen-orchestra.com/cant-find-hypervisor-information-in-sysfs/)
...
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
References (
...
networking)
- Network Configuration Examples (Xen 4.1+): http://wiki.xenproject.org/wiki/Network_Configuration_Examples_%28Xen_4.1%2B%29
- Ethernet Bridge + netfilter Howto (2005 but has a boot script example): http://www.tldp.org/HOWTO/Ethernet-Bridge-netfilter-HOWTO.html
- Network Configuration Examples (Xen WIKI): http://wiki.xen.org/wiki/Host_Configuration/Networking
- Bridging Network Connections (Debian WIKI): https://wiki.debian.org/BridgeNetworkConnections
...
Unlike xm, xl does not do dom0 network configuration; standard OS tools must be used.
For help (not --help or -h): xl help
In case there is no local xl man page: http://xenbits.xen.org/docs/unstable/man/xl.1.html and (Xen 4.2) http://manpages.ubuntu.com/manpages/raring/en/man1/xl.1.html
...
Each DomU (the VM itself, not its OS etc.) is configured by a file in /etc/xen.
Maintaining Debian in DomUs
...
When creating Debian systems it uses debbootsrap (described above).
Monitoring and controlling DomUs
Troubleshooting
TODO: integrate the next para.
References
Files and directories
...
TODO: integrate the next text
So basically bootloader (grub/pygrub or xen pv bootloader) sets up the kernel and initrd in memory, and boots the kernel. Kernel then extracts the initrd from the memory, and executes the script in the initrd. The script then loads the necessary drivers for *that* particular server hardware or a virtual machine to access the actual root disk, and then the script mounts the root disk so the actual Linux distribution can be started from the real root disk. So the initrd image you use must be suitable for the Xen domU and load the required kernel modules (possibly xenblk) and set up the xen xvd-disks!
References
Files and directories
File or directory | Usage | Notes |
---|---|---|
/etc/default/xen | ||
/etc/default/xend | ||
/etc/default/xendomains | ||
/etc/xen/ | Configuration | |
/etc/xen/scripts/ | ? | |
/etc/xen/scripts/vif-nat |
...
- Xen WIKI: http://wiki.xenproject.org/wiki/Main_Page
- Xen man pages: http://wiki.xenproject.org/wiki/Xen_Man_Pages
Setup logs
...
- Xen On Debian Wheezy With LVM (HowtoForge. Has bridge example with fixed IP): http://www.howtoforge.com/xen-on-debian-wheezy-with-lvm
- Using Xen With LVM-Based VMs Instead Of Image-Based VMs (HowtoForge. Etch): http://www.howtoforge.com/using-xen-with-lvm-based-vms-instead-of-image-based-vms-debian-etch
- Debian Wheezy -> Jessie and set up Xen (HowtoForge): http://www.howtoforge.com/how-to-set-up-xen-4.3-on-debian-wheezy-7.0.2-and-then-upgrade-to-jessie
- Setting up XEN on a Hetzner Dedicated Server (Squeeze, xen-create-image, xm): https://gist.github.com/meskyanichi/3354956
- Routed XEN VM based on LVM (step-by-step for Hetzner DS3000. Lenny): http://wiki.summercode.com/routed_xen_vm_based_lvm_step_by_step_guide_for_hetzner_ds3000
- Xen on 4 app servers (xl, no public IPs): http://wiki.xenproject.org/wiki/Xen_on_4_app_servers
- The Debian Administrator's Handbook, Virtualisation chapter (Nice. xen-tools, xm, bridged): http://debian-handbook.info/browse/stable/sect.virtualization.html
- How to install Xen in Debian (Armen's Wiki. Has scripts for both public and private IPs for virtual machines): http://vardump.org/wiki.php/HowToInstallXenInDebianGNULinux.