Which Linux Distribution Should I Use as a Xen Host

Is there an OS command I can run to determine if running inside a Xen based virtual machine

Dmesg may give some hints from the kernel message buffer, here is output on a virtualized Ubuntu instance from Slicehost:

bvm@qdbp:~$ sudo dmesg | grep Xen
[ 0.000000] Xen: 0000000000000000 - 00000000000a0000 (usable)
[ 0.000000] Xen: 00000000000a0000 - 0000000000100000 (reserved)
[ 0.000000] Xen: 0000000000100000 - 0000000010000000 (usable)
[ 0.000000] Booting paravirtualized kernel on Xen
[ 0.000000] Xen version: 3.1.2-rc1
[ 0.000000] Xen: using vcpu_info placement
[ 0.000000] Xen: using vcpuop timer interface
[ 0.000000] installing Xen timer for CPU 0
[ 0.021223] installing Xen timer for CPU 1
[ 0.046157] installing Xen timer for CPU 2
[ 0.046157] installing Xen timer for CPU 3
[ 0.265880] Initialising Xen virtual ethernet driver.

What is the best Linux distro for System Programming?

You're going to find the greatest of success with Debian or Gentoo. Debian, while primarily a binary release, has packages available that turns your system into more of a developer-based system. Gentoo compiles everything by default, so all the developer tools will already be in-place.

If you go with Debian, consider running Sid, their constantly-evolving, "experimental" branch. This will put you right around the same/similar package versions as Gentoo. Otherwise, at least use Squeeze, the next -stable release (a.k.a., Debian 6.0). Lenny's a bit old in the tooth, and uses the older, pre-2.6.30 Xen stuff (~3.2, I believe). Which might be too old for your needs.

In a pinch, you can see if one of the BSDs will work for you as well, like FreeBSD. I doubt its support for virtualization w/ Xen is at the same level as Linux (Xen was basically built around Linux, then ported to other platforms), but it's another option to consider. If you do, like with Debian's Sid, go with FreeBSD's -CURRENT branch for the latest & greatest.

As usual, read the manuals, and look on help sites for tips. For Gentoo, the forums at forums.gentoo.org are an invaluable resource after the manuals. Debian has their mailing list archives and some good documentation as well. Ditto for *BSD. You can also check in on IRC in #gentoo or #debian on FreeNode if you're really in a bind (Debian might be on OFTC, though, I don't remember). Be warned, though, you will be one voice among many in those channels (expect ~600+ users at the same time).

Xen bare metal hypervisor

Because Xen can be booted to directly from BIOS, without any other operating system in between Xen and the hardware. VMware ESXi is similar (differentiating itself from VMware workstation which requires a host OS).

Xen's dom0 privleged guest can be installed on the system before Xen is enabled, thus confusing matters about whether it is a bare metal install or not, but it is technically a true bare metal install that starts the dom0 guest. Note that you can often boot an alternate kernel which will bypass Xen and boot the dom0 "guest" as a true non-virtualized host (without Xen enabled).

how to set up xen cloud with single machine

There are currently two ways to set up the Xen Cloud Platform (XCP).

1) Install it with a ISO/CD install

http://xen.org/download/xcp/

2) Project Kronos

http://blog.xen.org/index.php/2011/07/22/project-kronos/

Pre-installed Linux for Web Developers?

Seriously, I think the best thing to do is create your own. Some people for example use Redmine instead of Trac. Finding a pre-configured VM with these specific installations is going to be difficult.

So, having the "create your own" as a precondition, I believe you have the following options:

Use a a "VM Aware" distro


Ubuntu Server comes to mind: it has an option to install a minimal installation specific to VMs.

Download the server ISO image, boot from it, press F4 on the first screen and select "Install a minimal virtual machine".

  • Less than 380MB installed footprint
  • Specialized server Kernel (-virtual)
  • Optimised for VMWare ESX, VMWare Server and KVM Intel or AMD x86 architecture
  • Minimum memory 128MB
  • No graphical environment preloaded as it is aimed at server virtual appliance

IMHO, you're going to spend at most a day configuring your VM to your tastes, not weeks. Using apt-get is going to save you some time in almost all packages in your feature list.

...and if you want even more customization, you can even try to use vmbuilder.

vmbuilder is a script that automates
the process of creating a ready to use
VM based on Ubuntu. There is no need
for a JeOS CD image. The currently
supported hypervisors are KVM, Xen and
VMware.

Use a well known distro and "strip it down"


Install a minimal Debian system and strip down some features, or create a small live image and use it.

Use Linux From Scratch (LFS) and build a system only with essential software


This is the most difficult one and you're going to spend a lot of time.

But you'll be able to have a really small distribution and understand how a Linux system really works. Understanding how everything works you can install just what is needed in your setup, and use lighter binaries like Busybox.

There's an old project called Debian From Scratch (last update is from 2006, so I don't know if it's reliable) that aims to do the same LFS does but using Debian.

(...) is a unique distribution that
allows you to install a Debian system
with almost the same level of control
as what you would get with a Linux
From Scratch installation but with the
Debian advantages (easy to update and
maintain).

You just want a Damn Small Linux out-of-box solution


Well, you can try Damn Small Linux, it's only 50mb and Debian Based and I believe it's the most famous minimal distribution (you can check more distros in this list). I just don't know how it would perform in a Web Server Development scenario.

Final advice


To all situations above, after configuring, save your VM as a default one for future use. Or better, use snapshots, each one with minor differences you may have with your installation (beware though that controlling too many snapshots may be a little cumbersome).

"I don't want to configure my own"


If for some reason you didn't like my approaches or don't have too much time to follow my advice ("create your own VM") you can check this question on ServerFault. There's a list for a bunch of appliances from different distros.

...but if you're going to test a bunch of them, to see if they fit your needs, why not just use the time spent with them creating your own?

Icing on the cake: use Vagrant to manage your vms.



Vagrant is a tool for building and distributing virtualized
development environments.

By providing automated creation and provisioning of virtual machines
using Oracle’s VirtualBox, Vagrant provides the tools to create and
configure lightweight, reproducible, and portable virtual
environments.

This means Vagrant helps you automating a lot of things you usually do when creating a new VM (these features are from the official website):

  • Automated virtual machine creation using Oracle’s VirtualBox
  • Automated provisioning of virtual environments using Chef, Puppet, or just shell scripts!
  • Full SSH access to created environments
  • Assign a static IP to your VM, accessible from your machine
  • Forward ports to the host machine
  • Shared folders allows you to continue using your own editor
  • Package environments into distributable boxes
  • Completely tear down environment when you’re done
  • Easily rebuild a complete environment with a single command

I would create a vm with the same configuration (well, almost the same) as my production server, so some platform problems would not appear just when deploying.

How to force a Xen VM to run a program

There's quite a challenge to what you're asking here, and I don't think there's the easy answer you were hoping for. You'll need to use different techniques under different circumstances - in particular, whether you're running Windows in your VMs, or a particular Linux distribution or something else, and in addition, are you running XenServer, or some Linux-distribution version of Xen?

One technique is to modify the filesystem image of the VM prior to booting it. In that way, you can drop in a script into a Linux VM's init scripts which will run on boot; on Windows (which I'm less familiar with, sorry) you could add a registry key and a program to execute on startup, if you can find the tools to modify the Windows filesystem from your Linux dom0. A bit tricky.

Another technique is to present a virtual CD-Rom image to the VM, with an auto-run script. With modern OSs no longer just running whatever they find inserted, you will probably have to get the user to click it to run it, but depending on your situation that might be OK.

Where is Xen Hypervisor installed?

Where is Xen Hypervisor installed? Will it be installed on existing OS
or hardware?

As explained in the fine wikipedia article, Xen is a bare-metal hypervisor, meaning it runs directly on the hardware.

However, as Xen itself has no user interface, it always requires at least one installed guest OS to work. There must be one OS guest that runs with special privileges (the so-called "dom0"). This dom0 is used to manage Xen, and so has a similar role to the host OS on a hosted hypervisor. So, while technically speaking Xen runs directly on your hardware, in practice you will still install an OS, then install Xen from inside the OS, just like for a hosted solution. However, you will then have to reboot into Xen (which will boot the dom0 OS).

What's the difference between Hypervisor and virtualbox?

Hypervisor is the general term, and both Xen and VirtualBox are implementations of hypervisors.

I know I can install virtualbox on my windows xp and then install a couple of VMS
with linux or windows on it.

Yes, you can do the same with Xen (though support for Windows guests seems to be more limited than with VirtualBox).



Related Topics



Leave a reply



Submit