Create New Xen VM from Scratch
From MyWiki
Create VM
- Create directory where you want to VM to reside
mkdir /var/vm/minnow
- On Fedora Core, the script xenguest-install.py can be used to create a new VM
xenguest-install.py -h xenguest-install.py -n minnow -r 512 -f /var/vm/minnow/disk0.img \ -l http://joe.ncsa.uiuc.edu/pub/fedora/linux/core/5/x86_64/os \ -p -s 10
Another good mirror is mirror.mcs.anl.gov/fedora-linux-core/5/x86_64/os
- Once the script is launched, the screen will switch into the console for the VM
- Follow these instructions for guest O/S installation
- After the O/S installation, click to reboot and you will receive the following message
If your install completed successfully, you can restart your guest by running 'xm create -c minnow'.
- Before starting the guest VM, move the configuration file to /var/vm/minnow and add the extension .conf
mv /etc/xen/minnow /var/vm/minnow/minnow.conf
- Edit minnow.conf and change on_crash to destroy
on_crash = 'destroy'
- Also, create a symlink in /etc/xen/auto so the VM will be restarted automatically on server reboots
ln -s /var/vm/minnow/minnow.conf /etc/xen/auto
- You may also want to increase the number of virtual CPUs assigned to the VM to greater than the default of 1 by adding the following line to minnow.conf
vcpus = 8
- Start the new VM
cd /var/vm/minnow xm create -c minnow.conf
- Return to these instructions, and follow the remaining instruction for server configuration (starting at the inittab section).
- If this is a new type of server, you may want to consider shutting it down at this point and save a copy of it as a reusable template for future VMs of this type. Here is the list of existing templates.
Other Resources
Another excellent document can be found here
