The problem: you cannot boot a paravirtualised machine from a CD-ROM for the purposes of installing a virtual machine. You may also be on a wireless link set up by NetworkManager and WLAN0 isn’t a bridged interface.

Here’s the solution:

  1. Download the ISO of your favourite distro and burn to DVD, then mount on your machine (this will probably happen just by inserting the disc on your drive).ย  If a window opens in your desktop, highlight the path in the address bar and copy it to the system clipboard (CTRL-C).
  2. Install Apache and start the apache/httpd service
  3. In /var/www/html (/var/www on debian, I believe) simply create a symbolic link to the directory where the DVD is mounted.ย  In this example, I am using CentOS:
    ย #ย  ln -s /media/CentOS_5.4_Final/ centos
  4. Now create the virtual machine, by starting up virt-manager, ensuring that it can connect to Dom0 and select New…
  5. In the Installation Source section of the virtual machine creation dialog,ย  specify the following parameter: Installation media URL: http://localhost/centos (the path to the installer repository)
  6. In the “type of network” selection, select Virtual Interface.
  7. Click through the rest of the set up – but BEFORE YOU COMPLETE IT, GET READY TO PAUSE THE VM. The virtual machine will start up automatically when you finish the set-up steps.
  8. As soon as you start the VM, the initial bootstrapping files should load and the distribution’s kernel should start up.ย ย  Only when the console window opens should you pause it!
  9. If you are using CentOS, you now need to modify the configuration file that’s been created, following these steps:
  1. Download the Xen kernel and initial ramdisk from here: http://mirror.centos.org/centos/5/os/x86_64/images/xen/ (change the path if you’re using an i386 host)
  2. Save them somewhere sensible: I made /var/lib/xen/boot and put them in there.
  3. Un-pause and Shutdown the virtual machine.
  4. Modify the config file, to include the paths to the xen-aware kernel and initrd (put these entries at the top, adjusting for your path as necessary):
    kernel = "/var/lib/xen/boot/vmlinuz"
    ramdisk = "/var/lib/xen/boot/initrd.img"
    
    

     

  5. IMPORTANT – also comment out the line for pygrub, so: = “/usr/bin/pygrub”
  6. Save the config and run the virtual machine. Nearly there!ย  Now open up the console to the virtual machine…
  • If you are prompted for a network address or DHCP, try DHCP.
  • If you are prompted for an installation path, stick to http. In a network interface dialog that may appear, choose a manual address that doesn’t conflict with other hosts on your real network (but make sure it’s valid for your network!!)
  • Because the VM now has a virtual network interface, http://localhost/centos is a meaningless path.ย  If the installer identifies this and prompts for an alternative path to the stage2.img file [true in CentOS, at least], then do the following on your host (real) machine:
    # ifconfig wlan0(substistute eth0 for wlan0 if you’re using a wired ethernet connection)
  • Paste/type the IP address from the output of ifconfig into the path dialog of the halted installer, but keep the /centos/ directory.
  • The installer should then run through the rest of the motions and voila – a paravirtualized virtual machine installed from local CD/DVD-ROM.

    When the installer has finished running, uncomment the pygrub line in the config file.

    If you spot any errors with this process, please let me know so I can correct the procedure.

    Happy Christmas! ย  *<(:-##

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Your post must include a link to this post.

    How does this work?
    Write a response on your own website and include a link to this post. Then submit your responseโ€™s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.