Grant McWilliams

Automated install of Debian Wheezy VM (64 bit) using preseed

Note: This is not totally automated yet. I need to fix several things.

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution
 

Introduction

In this tutorial I create a disk, download a kernel, preseed file and install Debian Wheezy using the preseed file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a Ubuntu mirror locally then downloading my files and editing them.

 

 Note: This tutorial is designed so you can copy and paste the text inside the boxes. I don't actually type any of this in and neither should you.

 

1. Getting the network info

This line gets the Network UUID for xenbr0. If you're using a different bridge you will want to insert it here. Get a list of XCP networks with xe network-list. This network is connected to the outside interface. This tutorial requires there to be a DHCP server on this network answering requests and providing network access to the Internet.

NETUUID=$(xe network-list bridge=xenbr0 --minimal)

2. Creating the VM and setting parameters

Here we create a new template from the Debian Squeeze template. Then we create the VM from the new Debian template, create a network interface and add it to our network from step one. Additional settings are for configuring the install repository and specifying thepreseed file from my site. The last setting turns off VNC so we can watch the install via a text console (very important in my environment).  Even if you can't see all the text below just highlight and paste. The text is there even if it's not visible.

 

TMPLUUID=$(xe template-list | grep -B1 'name-label.*Debian.*Squeeze.*64-bit' | awk -F: '/uuid/{print $2}'| tr -d " ")
VMUUID=$(xe vm-install new-name-label="Debian Wheezy" template=${TMPLUUID}) 
xe vif-create vm-uuid=${VMUUID} network-uuid=${NETUUID} mac=random device=0
xe vm-param-set uuid=${VMUUID} other-config-install-repository=http://ftp.us.debian.org/debian/
xe vm-param-set uuid=${VMUUID} other-config:debian-release=wheezy
xe vm-param-set uuid=${VMUUID} other-config:install-methods=http,cdrom,ftp,nfs
xe vm-param-set uuid=${VMUUID} PV-args="netcfg/get_hostname=Wheezy debian-installer/locale=en_US console-keymaps-at/keymap=us console-setup/layoutcode=us console-setup/ask_detect=false interface=eth0 netcfg/disable_dhcp=false preseed/url=http://grantmcwilliams.com/files/preseed-debian-wheezy.cfg console=hvc0"
xe vm-param-set uuid=${VMUUID} other-config:disable_pv_vnc=1

3. Starting the VM and watching the install

The VM installs without any interaction from the user at this point. It is however, nice to watch it using xenconsole. Once it's done installing it will shutdown.

If you're using XCP 1.0/1.1

xe vm-start uuid=$VMUUID
DOMID=$(xe vm-list uuid=${VMUUID} params=dom-id --minimal)
/usr/lib/xen/bin/xenconsole ${DOMID}

If you're using XCP 1.5b/1.6

xe vm-start uuid=$VMUUID ; xe console uuid=$VMUUID

4. Starting the VM and configuring settings

We need to boot the VM up again and using xenconsole log in to reset the finish configuration.

If you're using XCP 1.0/1.1

xe vm-start uuid=$VMUUID
DOMID=$(xe vm-list uuid=${VMUUID} params=dom-id --minimal)
/usr/lib/xen/bin/xenconsole ${DOMID}

If you're using XCP 1.5b/1.6

xe vm-start uuid=$VMUUID
xe console uuid=$VMUUID

Now that your Debian Wheezy VM is running you can login. The password was automatically set by the preseed file.

  • Username: debian
  • Password: password

Reset the ubuntu users password.  If you want to keep the IP assignment dynamic note the ip address.

5. Shutting down the VM and re-enabling VNC

If you're going to use XVP or some other method of connecting to the VMs direct VNC connection you'll need to enable it.

xe vm-shutdown uuid=$VMUUID
xe vm-param-remove uuid=${VMUUID} other-config:disable_pv_vnc
xe vm-start uuid=$VMUUID

7. Export our VM for safe keeping

Before you start modifying the base Debian Wheezy image you should back it up.

xe vm-export uuid=$VMUUID filename=DebianWheezy-base.xva

Be aware that you may not have enough space on the Control Domain's disk to export it. A good solution (and shorter than explaining how to add disks to the control domain) is to mount an nfs volume and export it there.

mount nfsserver:/share /media/share
xe vm-export uuid=$VMUUID filename=/media/share/DebianWheezy-base.xva

This would mount the NFS share on nfsserver to /media/share. The exported disk would be saved on the NFS share.

 

Add a comment

Automated install of Kali Linux VM (64 bit) using preseed

Note: This has not really been tested yet. I wanted to get it up here so people can start using it and I can work on it.

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution
 

Introduction

In this tutorial I create a disk, download a kernel, preseed file and install Kali LInux using the preseed file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a Ubuntu mirror locally then downloading my files and editing them.

 

 Note: This tutorial is designed so you can copy and paste the text inside the boxes. I don't actually type any of this in and neither should you.

 

1. Getting the network info

This line gets the Network UUID for xenbr0. If you're using a different bridge you will want to insert it here. Get a list of XCP networks with xe network-list. This network is connected to the outside interface. This tutorial requires there to be a DHCP server on this network answering requests and providing network access to the Internet.

NETUUID=$(xe network-list bridge=xenbr0 --minimal)

 

2. Creating the VM and setting parameters

Here we create a new template from the Debian Squeeze template. Then we create the VM from the new Debian template, create a network interface and add it to our network from step one. Additional settings are for configuring the install repository and specifying thepreseed file from my site. The last setting turns off VNC so we can watch the install via a text console (very important in my environment).  Even if you can't see all the text below just highlight and paste. The text is there even if it's not visible.

 

TMPLUUID=$(xe template-list | grep -B1 'name-label.*Debian.*Squeeze.*64-bit' | awk -F: '/uuid/{print $2}'| tr -d " ")
VMUUID=$(xe vm-install new-name-label="Kali Linux" template=${TMPLUUID}) 
xe vif-create vm-uuid=${VMUUID} network-uuid=${NETUUID} mac=random device=0
xe vm-param-set uuid=${VMUUID} other-config-install-repository=http://http.kali.org
xe vm-param-set uuid=${VMUUID} other-config:debian-release=kali
xe vm-param-set uuid=${VMUUID} other-config:install-methods=http,cdrom,ftp,nfs
xe vm-param-set uuid=${VMUUID} PV-args="netcfg/get_hostname=Kali debian-installer/locale=en_US console-keymaps-at/keymap=us console-setup/layoutcode=us console-setup/ask_detect=false interface=eth0 netcfg/disable_dhcp=false preseed/url=http://grantmcwilliams.com/files/preseed-kali-linux.cfg console=hvc0"
xe vm-param-set uuid=${VMUUID} other-config:disable_pv_vnc=1

 

3. Starting the VM and watching the install

The VM installs without any interaction from the user at this point. It is however, nice to watch it using xenconsole. Once it's done installing it will shutdown.

If you're using XCP 1.0/1.1

xe vm-start uuid=$VMUUID
DOMID=$(xe vm-list uuid=${VMUUID} params=dom-id --minimal)
/usr/lib/xen/bin/xenconsole ${DOMID

If you're using XCP 1.5b/1.6

xe vm-start uuid=$VMUUID ; xe console uuid=$VMUUID

4. Starting the VM and configuring settings

We need to boot the VM up again and using xenconsole log in to reset the finish configuration.

If you're using XCP 1.0/1.1

xe vm-start uuid=$VMUUID
DOMID=$(xe vm-list uuid=${VMUUID} params=dom-id --minimal)
/usr/lib/xen/bin/xenconsole ${DOMID}

 

If you're using XCP 1.5b/1.6

xe vm-start uuid=$VMUUID
xe console uuid=$VMUUID

 

Now that your Kali Linux VM is running you can login. The password was automatically set by the preseed file.

  • Username: root
  • Password: password

Reset the root users password.  If you want to keep the IP assignment dynamic note the ip address.

5. Shutting down the VM and re-enabling VNC

If you're going to use XVP or some other method of connecting to the VMs direct VNC connection you'll need to enable it.

xe vm-shutdown uuid=$VMUUID
xe vm-param-remove uuid=${VMUUID} other-config:disable_pv_vnc
xe vm-start uuid=$VMUUID

 

7. Export our VM for safe keeping

Before you start modifying the base Kali Linux image you should back it up.

xe vm-export uuid=$VMUUID filename=Kali-Linux-base.xva

 

 

Be aware that you may not have enough space on the Control Domain's disk to export it. A good solution (and shorter than explaining how to add disks to the control domain) is to mount an nfs volume and export it there.

mount nfsserver:/share /media/share
xe vm-export uuid=$VMUUID filename=/media/share/Kali-Linux-base.xva

 

This would mount the NFS share on nfsserver to /media/share. The exported disk would be saved on the NFS share.

 

Add a comment

Copy of Automated install of CentOS 7 VM (64 bit)

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was written in the spirit of my CentOS 6 virtual machine (64 bit) installation on Xen howto. In that tutorial I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

I now use Xenserver and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.

This tutorial is for CentOS version 7. 

 

Add a comment

Read more: Copy of Automated install of CentOS 7 VM (64 bit)

Automated install of Fedora 20 VM (64 bit)

Note: updated for XCP 1.5b/1.6 and Xenserver 6.x

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was originally written for CentOS and has been adapted for Fedora 20 x86_64. 

Add a comment

Read more: Automated install of Fedora 20 VM (64 bit)

Automated install of Fedora 20 VM (32 bit)

Note: updated for XCP 1.5b/1.6 and Xenserver 6.x

Install Type

  • Non-interactive
  • Network boot
  • Commandline
  • Paravirtualized

Prerequisites

  • XCP/Xenserver
  • Access to Internet
  • Working DHCP server
  • Working DNS name resolution

Introduction

This tutorial was originally written for CentOS and has been adapted for Fedora 20. 

Add a comment

Read more: Automated install of Fedora 20 VM (32 bit)

Xen Howtos

Having moved to Xen Cloud Platform recently I don't anticipate there being more Howto's in this category in the future. I do however, keep up the CentOS installation tutorials because of popular demand.

 

{loadposition content_xenlist}

Add a comment

Xenserver Howtos

Xen Cloud Platform is the free/open community driven version of Citrix Xenserver.  I've moved all of my Xen Virtual Machines to Xen cloud Platform so any future tutorials will most likely be about XCP. I've found XCP to be a wonderful product but not necessarily an easy tool sometimes thus the tutorials you see below.

Citrix Xenserver has been opensourced and thus there's no need for Xen Cloud Platform any longer. Most of the tutorials here work on both but all future tutorials will be targeting Xenserver. As time permits I'm updating tutorials for Xenserver 6.5 (Creedence) - Jan 15, 2014.

How to get started: Go to xenserver.org and download the latest ISO disk image of Xenserver and install it on a machine. If you don't have a CD drive on your Xenserver host put the installer on a USB drive. It uses the whole machine as it's an appliance so beware. By the way I think this is the best design strategy. It's a good idea to let your Hypervisor/Cloud stack focus on what it's good at and not use it for playing World of Warcraft. ;-)

Expect a great deal more Howtos in the future. Feel free to request them as well. If it's within scope of what I'm doing I may create one just for you.

 These tutorials can also be found on the Xenapi Admin Project website and the XCP wiki.

 

 

{loadposition content_xcplist}

Add a comment

VirtualBox Howtos

I use VirtualBox almost every day but I haven't created a product around it in a very long time so the Howto's here will probably be very old until the time comes when I'm digging into it again.

{loadposition content_vboxlist}

Add a comment

KVM Howtos

I don't generally use KVM so the Howto's here are old and probably obsolete.

 

{loadposition content_kvmlist}

Add a comment

Microwave Cassoulet brought to you by Betty Crocker

This is not a joke! My daughter checked out a Betty Crocker cookbook from the local library. She was showing me some recipes in it as normally I would not have even opened it. About halfway through there was an Easy Cassoulet recipe. Intrigued I looked it over. Seconds later my jaw dropped in disbelief. You, my faithful readers probably remember my Cassoulet article from the past. If not then go there now and read up on it, I'll wait for you. In that recipe (which is quite good) there are no less than 19 ingredients and start to finish it takes about 3 days to prepare spread out over one month. I never thought any meal could be worth that kind of labor and yet I've made it 4 times. Now my least favorite season - Fall, is welcomed open armed just because it gives me an excuse to break out the butcher knife and soak those great northern white beans until they're smooth as butter. Yes, I'm hooked.

Betty Crocker I'm sure thinks they're doing their readers a great service having an Easy Cassoulet recipe because who wouldn't want to partake in this rustic southern French dish? The recipe is as follows.

 

  • 1 pound of Polish sausage
  • 1 can of great northern beans
  • 1 can of kidney beans
  • 1 can of black beans
  • 1 can of tomato sauce
  • 3 medium carrots
  • 2 small onions
  • 2 tbs brown sugar
  • 1/2 cup of dry red wine or beef broth
  • 1 1/2 tsp dried thyme leaves
  • 2 cloves of garlic

 

In the interest of their consummate readers they've even included microwave directions *gag cough gag* as follows.


To Microwave: Place carrots and red wine in 3 qt microwavable casserole. Cover and microwave on high for 5 minutes. Place sausage on carrots. Mix remaining ingredients. Pour over top. Cover tightly and microwave on high 18 to 22 minutes, stirring after 12 minutes, until hot and bubbly.

Can we have a moment of silence to honor the death of our dear old friend? If you don't mind I'd like to say a few words. "Cassoulet, I'm sorry for what has become of you. I'm sorry for how little we've tried to understand your complexity and how we've attempted to make you into something you're not out of our own laziness and for the sake of convenience. But most of all I'm sorry that you had to go out this way, with such a loss of dignity, please forgive us - amen."


Polish sausage and 3 cans of beans? Are you on crack Betty Crocker? Betty Coker is more like it. What can they possibly think to accomplish by putting Polish sausages and 3 types of canned beans in a microwave dish and cooking it for 20 minutes? I'm not saying you have to spend three days cooking Cassoulet but there are some dishes that if you don't plan on cooking them right you should just leave them the hell alone! Or here's another idea, microwave your sausage and beans but call it microwaved sausage and beans - not Cassoulet. >

I have other issues with it. I don't believe I'm actually giving it any time at all but dry red wine OR beef broth? Oh you don't have any dry red wine for your wine reduction to pour over that Chateaubriand? Just use beef broth, they taste about the same. Ack! I can't think of an instance where you'd substitute beef broth for red wine. I just can't. Speechless I may not be but flabbergasted I am.

 

 

Add a comment