User Tools

Site Tools


user:kkrauss1:portfolio:vmserv

VM server install(squeeze)

Installation of operating system and setup

  • We are going to install a linux distribution called debian squeeze and set it up as a virtual server machine.
  • The first steps are going to be virtually identical to the Desktop install project
    • Boot the chosen and used the network boot option
    • Go to the debian option and pick squeeze
    • As is customary with OS installs you will be asked various questions involving location and preferences
    • Pick proper locations, and I recommend using entire disk and letting the install do the work for you
    • Chose to install grub
  • Here are where things start to get slightly different
    • When prompted for a Domain Name verify that the default is “student.lab” and press
    • When prompted to choose a mirror site use the arrow keys to move to the top of the list and select “enter information manually” hit enter and type “mirror” and hit enter again
    • Remember no proxy is needed
    • Chose your user names and passwords as you see fit(common password used in the lair is bob so that Matt can address any issues if student is not around)
    • Being that this is a vm server we want as little as possible, so when prompted simply uncheck all package options. Yes this includes the desktop interface since we want as many of the system resources as possible.
    • The install part is now complete

Making sure squeeze knows where to go for updates

  • We are far from finished though!
    • Go ahead and log in with the user name and password you picked( you can log in as root but its considered bad practice)
    • now type “su” and hit enter
    • now type in the password for root
    • you are now a super user aka root and should have a # at your command prompt
  • Now we want to change some things so that the operating system knows where to go for update packages
    • Type “cd /etc/apt” and hit enter
    • There is a file in this directory called sources.list. Type “mv sources.list sources.list.bak”. You could also delete it but its good practice to keep backups.
    • Now we want to get a new source list from http://web.lair.lan/files/student/sources.list. You could simply copy the information manually or you can type “wget http://web.lair.lan/files/student/sources.list” and hit enter
    • Now you want to use any editor of your choosing to open the sources.list file you just copied and change any instance of “debversion” to “squeeze”.

Updating and installing necessary packages to create a VM server

  • Now that we have a proper source.list we want to update squeeze and get all the packages we need to turn this into a Virtual machine server
    • Type aptitude update and hit enter
    • Type aptitude upgrade and hit enter
    • Now there are three software packages we want to install, we need ssh, xen linux system and xen tools. First we want to do an aptitude search to see what the current package names are. So type “aptitude search ssh” hit enter.
    • The list is long but we know that we want to access our virtual machine server from remote machines so openssh-server is the package we need. So we type “aptitude install openssh-server” and hit enter
    • Now lets search for our xen packages, type “aptitude search xen” and hit enter.
    • We know we need xen tools and xen linux system, there is only one version of tools so that is easy but there are four versions currently of linux system. Simply pick the one with the newest kernel listed. So type “aptitude install xen-tools” hit enter then “aptitude install xen-linux-system-2.6.32-5-xen-686” and hit enter.(Keep in mind if you follow these instructions the package names could have changed).

Configuring our VM server

Initial setup and changes

  • Now we can really get to the nitty gritty
    • From a remote machine you can now ssh into your virtual machine server. Mine is not listed in the dns server so I had to ssh in using the IP address. “ssh root@10.80.2.192” and hit enter, then go through prompts until asked for password and enter it. (the reason I am using an ip address instead of a host name is because the VM server I am creating is not connected to lab46's DNS, that will be a future project. So keep in mind when you do the setup it you might not need an ip address or it could be different.)
    • Now that we are logged in we have to do some tweaking so things will work the way we want. The first thing we want to do is open up the file /etc/modules and add the line “loop max_loop_255”. If we don't do this things will break in the future and we won't know why.
    • There are some other changes we need to make otherwise we will have some issues in the future.
    • Open “/etc/xen/xend-config.sxp“ and do a search for frob_iptable. Below that you will see “iptables “$c” FORWARD -m physdev –physdev-in “$vif” “$@” -j ACCEPT \” change it to: ” iptables “$c” FORWARD -m physdev –physdev-is-bridged –physdev-in “$vif” “$@” -j ACCEPT \“
    • You will also see ” –physdev-out “$vif” -j ACCEPT 2>/dev/null“ change that to: ” –physdev-out “$vif” -j ACCEPT 2>/dev/null“

Editing xen-tools.conf

  • Now we want to edit the xen-tools.conf file, fortunately this information has been supplied to us, it took other students a lot of digging to find it. Without these changes we would have problems in the future.
    • Go to /etc/xen-tools directory and open xen-tools.conf with an editor of your choice.
    • Now you can simply delete everything in the file, you can also simply mv the file and create a new one.
    • Now copy the following into the file:
  # /etc/xen-tools/xen-tools.conf
  #
  
  ##
  ## Virtual Machine configuration
  ##
  dir             = /xen
  install-method  = debootstrap
  
  ##
  ## Disk and Sizing options
  ##
  size            = 2Gb      # Disk image size.
  memory          = 128Mb    # Memory size
  swap            = 128Mb    # Swap size
  fs              = ext3     # use the EXT3 filesystem for the disk image.
  dist            = squeeze  # Default distribution to install.
  images          = full
  
  ##
  ## Network configuration
  ##
  dhcp            = 1
  gateway         = 10.80.3.1
  netmask         = 255.255.255.0
  
  ##
  ## Password configuration
  ##
  passwd          = 1
  
  ##
  ## Package Mirror configuration
  ##
  arch            = i386
  mirror          = http://mirror/debian/
  mirror_squeeze  = http://mirror/debian/
  
  ##
  ## Filesystem settings
  ##
  ext3_options    = noatime,nodiratime,errors=remount-ro
  ext2_options    = noatime,nodiratime,errors=remount-ro
  xfs_options     = defaults
  reiser_options  = defaults
  
  ##
  ## Xen VM boot settings
  ##
  pygrub          = 1
  
  ##
  ## Xen VM settings
  ##
  serial_device   = hvc0
  disk_device     = xvda
  
  ##
  ## Xen configuration files
  ##
  output          = /xen/conf
  extension       = .cfg

Changes to grub

  • Now we have to make some changes to grub, this is done because grub will give us problems with xen if we don't. (Grub is a bootloader)
    • change to /etc/default and open “grub” with an editor of your choice
    • Add the following to the end of the file:
   # Disable OS prober to prevent virtual machines on logical volumes from
   # appearing in the boot menu.
   GRUB_DISABLE_OS_PROBER=true
  • Now change diretory to /etc/grub.d
    • mv 10_linux to 50_linux
    • Type update-grub2
    • now open up the file “xendomains” in /etc/default with an editor of your choice and make the following changes:
  
  XENDOMAINS_SAVE=/var/lib/xen/save
  

gets changed to:

  
  XENDOMAINS_SAVE=""
  

Then change the XENDOMAINS_RESTORE line to:

  
  XENDOMAINS_RESTORE=false

Final tweaks

  • It is standard to create directories for common “things” so do the following:
    • Type “mkdir /xen” and press <Enter>.
    • Type “mkdir /xen/images” and press <Enter>.
    • Type “mkdir /xen/boot” and press <Enter>.
    • Type “mkdir /xen/conf” and press <Enter>.
    • Type “mkdir /xen/save” and press <Enter>.
  • Now lets reboot the system so we can check how we did
    • Type shutdown -r now

Initial setup and changes

  • Now for testing
    • After you reboot and log in type the command “xm list” if all you see is Domain0-0 then your vm server is complete!!

References

  • Thanks to Brian Ewanyk, Matt Haas, and even Justin Hammond for their help!
user/kkrauss1/portfolio/vmserv.txt · Last modified: 2012/03/15 12:06 by kkrauss1