How install a qemu server

Updating and Upgrading

  • To start off the VM setup,we need to install the updates for the machine
apt-get update
apt-get upgrade

Finding your Kernel

  • Typing this will find your current Linux kernel so you can remove it
apt-cache search linux-image

Installing the 64-bit amd kernel

  • This command will install the 64-bit kernel that will take full use of your cpu and memory
apt-get install linux-image-amd64

Removing your old linux kernel

  • This will remove the current linux kernel that doesn't take full use of your cpu and memory
apt-get remove linux-image-2.6.32-5-486

Installing Git

  • This will install git, which is where you get your directories from
apt-get install git

Getting your git clones

  • These will clone the directories
git clone
git clone

Moving the debian directory under the createvm directory

  • This will move the debian directory underneath the createvm directory
mv createvm-debian/ createvm/debian

Getting the packages necessary in order to debuild

  • These packages must be installed otherwise the debuild will not function correctly, and an error will pop up
apt-get install build-essential
apt-get install debhelper
apt-get install asciidoc

Renaming the createvm

  • In order for the debuild to complete, the createvm must be renamed to what is listed
mv createvm/ createvm-0.0.1
  • Move up a directory
cd ..

Making your tar balls

  • Another action required in order for the debuild to complete is to make a tar ball
tar czvf createvm_0.0.1.orig.tar.gz createvm-0.0.1
  • Move back down to the createvm directory
cd createvm-0.0.1
  • move down to the document directory
cd doc

Touching the file

*The debuild will not successfully complete unless you touch the files listed below

touch createvm.1M
touch cm.1
  • move up directories
cd ..

The time to debuild has come at last

  • We can finally debuild, but make sure to type everything below, or the debuild will fail
debuild -us -uc
  • Installing your .deb file
dpkg -i createvm_0.0.1-2_i386.deb
  • Chances are you are going to get an error when you do the step listed above, so you will need to install the packages needed in order to continue
apt-get -f install
  • Now rerun the depackage
dpkg -i createvm_0.0.1-2_i386.deb

Now, I hope you have your original FAI CD, if not, then burn yourself another one. You need an FAI CD in order to continue

  • From here, you will want to go to your largest directory, usually it will be /home, or just home
cd /home
  • Now you want to make a directory called VMs, and go inside of it
mkdir VMs
cd VMs
  • Now create another directory, the same way you did above, only name it "iso"
mkdir iso
  • Now go into that directory
cd iso
cat /dev/sr0 > fai_dvd.iso
emacs /etc/createvm/createvm.conf
  • Look for the directory containing install cds, it should say /home/VMs/iso
  • The other directory that we need to look at is the directory containing VMs, you will have to change it to what is listed below
  • Before we can actually run the virtual machine we have to make some changes to use an additional hard-drive, this is also the point at which we are going to add an additional drive to the machine. The drive does not have to be very big, just around 40-50 GB will suffice.
fdisk -l
fdisk /dev/sdb
  • Delete all your partitions with "d" then the partition you want to delete, for the purposes of this virtual machine, we will need to delete all of them

After you have deleted all of your partitions, next we create the physical volume for the VMs

pvcreate /dev/sdb
vgcreate tearoff /dev/sdb
  • Now we need to make some changes to the emacs
emacs /etc/createvm/tearoff.conf
  • In emacs, look for the header called "POOL_PV_TYPE", change this to "pool" (include the quotations for this one)
createvm qemufaiserver tearoff fai_dvd.iso
cd qemufaiserver-tearoff-1
screen -r qemufaiserver-tearoff-2
dpkg-reconfigure arno-iptables-firewall
  • A pop-up window asking you if you want to manage your firewall with debconf, you want to select "Yes"
  • Hit "Ok", then in the next window, type "eth0"
  • The answer to the next question is "Yes"
  • Type "22 53", then hit "Ok"
  • In external UDP-ports, type "53",then hit "ok"

The machine then should be set to be pingable from the outside world

  • Now in internal network interfaces, type "tap0" and hit ok
  • Now in internal subnets, type "" and hit ok
  • Yes, you do want to enable NAT
  • Internal networks with access to external networks, leave this blank
  • Should the firewall be restarted? YES!!!
  • From this point, you should be able to start-up your virtual machine
screen -r qemufaiserver-tearoff-2

Last modified 9 years ago Last modified on Jun 11, 2012, 10:19:51 PM