Oops. That didn't work as well as I'd hoped. This should teach me not to post simply because the install started. (Probably not.)
Once the W98 VM rebooted, it reported Invalid system disk. I did two things to correct this. First, I ensured the LVM partition was set to 500M, as W98 did not provide native support for disks over 512M. Second, I booted from the CD, and rather than installing, selected recovery mode. From there, I fdisk'd the partition to ensure the MBR was set properly.
After a second install, the VM booted (better than before), but crashed as a result of VCACHE: Windows protection error failure.
Wednesday, September 17, 2008
I Got A Promotion
Windows 98 under Xen
As I continue to have more and more fun with Xen, I wanted to virtualize a couple old Windows systems. You won't believe my motivation... I only have one license for Windows XP, but wanted a couple other machines. Yes, that's right: I didn't want to pirate XP. Imagine that.
Since I have a couple copies of 95 and 98SE in the filing cabinet, it was time to give them a try. I couldn't get the wizard to work, but had better luck from the command line. The first trick was to add another packager, virt-viewer. The following launched an install:
The first pass required that the virtual disk be intialized, and required a reboot of the guest. The reboot failed, however, forcing me to issue:
Since I have a couple copies of 95 and 98SE in the filing cabinet, it was time to give them a try. I couldn't get the wizard to work, but had better luck from the command line. The first trick was to add another packager, virt-viewer. The following launched an install:
# virt-install -n VM02-w98 -r 270 -f /dev/vg0/vm2w98 -l /net/scully/var/ftp/iso-w98se/w98se.iso -v --vnc
The first pass required that the virtual disk be intialized, and required a reboot of the guest. The reboot failed, however, forcing me to issue:
# virsh destroy VM02-w98; virsh undefine VM02-w98This was followed by a second install command, which proceeded as normal.
Monday, September 08, 2008
Cosmic Motors Gallery
Check out Daniel Simon's Super Cool Sci-Fi Cars From Another Galaxy. Great pictures, but I still think aliens shouldn't be speaking English.
Saturday, September 06, 2008
No "Raw Device Mapping" for Xen
One invaluable feature of the Vmware ESX architecture, is the Raw Device Mapping (RDM). This allows a virtual machine to access a partitions and format it using the "native file system of the guest operating system." (In other words, a Windows VM would format it as NTFS. A Linux VM would format it as EXT3.) The advantage to this is that a physical machine could easily access the same data, should the VM crash or become corrupted.
Unfortunately, this doesn't seem to work as I had hoped under Xen. I carved a partition out of Dom0's hard drive and mapped it to the VM:
Once the partition attached, the DomU could see the partition as a separate drive, but not as file system. It was necessary to fdisk /dev/xvdb, then mke2fs -j /dev/xvdb1. So far, so good. The tricky part came when I tried to access partition from Dom0:
Unfortunately, this doesn't seem to work as I had hoped under Xen. I carved a partition out of Dom0's hard drive and mapped it to the VM:
# virsh attach-disk valkyrie /dev/hda7 xvdbThis failed, until I formatted the partition. That makes sense.
Once the partition attached, the DomU could see the partition as a separate drive, but not as file system. It was necessary to fdisk /dev/xvdb, then mke2fs -j /dev/xvdb1. So far, so good. The tricky part came when I tried to access partition from Dom0:
]# virsh detach-disk valkyrie xvdbNow, it doesn't recognize that the partition is formatted. What a bummer. This seems to imply that the avoid data loss due to a corrupted image file, we need to place the data on Dom0, then cluster to the local VMs through the local bridge, virbr0.
# mount /dev/hda7 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/hda7,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Xen Error (22, "Invaid argument"): Pt 2
I give up. The problem was that domains would install correctly, but fail to start.
At first, I thought the failures were when I would install from a kickstart file. During the install, a template kickstart is created as anaconda.cfg, which contains:
To review the bootloader options, I used:
Next, I found that I could bypass Grub. The trick was to add extra directives to the domain config file:
This caused me to realize two things. First: root should not xvda1 but xvda2 or xvda3, as boot would be xvda1. Second: root was on an LVM not a xvda.
So, I reimaged the VM using an image file rather than LVMs. Worked. How strange.
Okay, a couple important issues here: This is Xen 3.0 (as explained in an earlier post), but I don't think that is the prime factor. I am trying to put the image on an logical volume, on a software raid. I know LVM images work fine under 3.1, and others having ti running on 3.0, but I've found no one else trying the three together. It seems the three just don't seem to play well with one another.
At first, I thought the failures were when I would install from a kickstart file. During the install, a template kickstart is created as anaconda.cfg, which contains:
bootloader --location=mbr --driveorder=hda --append="rhgb quiet"If a domain is manually installed, the line is:
bootloader --location=mbr --driveorder=vxda --append="console=xvc0"My kickstart was actually misconfiguring the boot loader.
To review the bootloader options, I used:
xm create -c domainThis let me get into Grub. Unfortunately, that means Error 22 isn't an MBR problem. No efforts to fix via Grub provided any help.
Next, I found that I could bypass Grub. The trick was to add extra directives to the domain config file:
kernel = "/boot/vmlinuz-2.6.18-1.2798.fc6xen"Notice that the bootloader directive is commented out. This failed marvelously, but got further than before. The errors were similar to a lost root partition.
root = "/dev/xvda1 ro"
ramdisk = "/boot/initrd-2.6.18-1.2798.fc6xen.img"
#bootloader="/usr/bin/pygrub"
This caused me to realize two things. First: root should not xvda1 but xvda2 or xvda3, as boot would be xvda1. Second: root was on an LVM not a xvda.
So, I reimaged the VM using an image file rather than LVMs. Worked. How strange.
Okay, a couple important issues here: This is Xen 3.0 (as explained in an earlier post), but I don't think that is the prime factor. I am trying to put the image on an logical volume, on a software raid. I know LVM images work fine under 3.1, and others having ti running on 3.0, but I've found no one else trying the three together. It seems the three just don't seem to play well with one another.
Tuesday, September 02, 2008
Mounting A Xen LVM Image
How to access a VM's logical volumes from Dom0. This assumes the VM is powered off and its image resides on an LVM (LVM's inside an LVM). It will not access /boot or the MBR.
Attach and confirm the imageThe single biggest "gottcha" is the need to ensure that Dom0 and the DomU's don't use the default volume group name.
# kpartx -a /dev/volume/domain
# kpartx -l /dev/volume/domain
Acquire and access the logical volumes
# vgscan
# lvdisplay | grep -i "Name\|Status"
# vgchange -ay
# lvdisplay | grep -i "Name\|Status"
Mount and view the volumes
# mount /dev/VolGroup00/LogVol00 /mnt
# cd /mnt
# ls -l
# cat /mnt/etc/hosts
# df
Umount, inactivate, and detach the volumes
# cd
# umount /mnt
# vgchange -an
# kpartx -d /dev/volume/domain
Xen Error (22, "Invaid argument")
Occasionally, with enough regularity to be very annoying, a Xen guest that installs fails to start, throwing the error:
The error descriptions are listed in the phython control script, but are not passed to the user. All we get is Invalid argument. Gee, thanks.
Stay tuned.
libvir: Xen Daemon error : POST operation failed: (xend.err "Error creating domain: (22, 'Invalid argument')")I had little luck finding the nature of Error 22, until I hacked the code.
error: Failed to start domain valhalla
The error descriptions are listed in the phython control script, but are not passed to the user. All we get is Invalid argument. Gee, thanks.
# tail -70 /usr/lib/python2.4/site-packages/libvirt.pyNotice number 22: No OS. Okay, that I can deal with. It can't find the boot sector. All we need is a virtual rescue disk.
--------- snip ---------
VIR_ERR_NO_SOURCE = 19
VIR_ERR_NO_TARGET = 20
VIR_ERR_NO_NAME = 21
VIR_ERR_NO_OS = 22
VIR_ERR_NO_DEVICE = 23
VIR_ERR_NO_XENSTORE = 24
VIR_ERR_DRIVER_FULL = 25
--- output truncated ---
Stay tuned.
Disappearing Xen Config Files
An interesting "feature" of Xen 3.0 is that when you issue:
BTW: Yes, I know 3.0 an old version, but I'm still running FC6 on my infrastructure hardware. Why? Because if it ain't broke... don't fix it. My Fedora 7 Virtualization server has 3.1, which seems to be current as of this writing. Again, no reason to go to Fedoras 9, if its running 3.1, also.
virsh undefine domainit executes:
rm -rf /etc/xen/*domain*This means you can't keep revisions of the config file in the directory.
BTW: Yes, I know 3.0 an old version, but I'm still running FC6 on my infrastructure hardware. Why? Because if it ain't broke... don't fix it. My Fedora 7 Virtualization server has 3.1, which seems to be current as of this writing. Again, no reason to go to Fedoras 9, if its running 3.1, also.
Disconnecting SSH Xen Console
I SSH's into a server then launched a Xen console, and found myself stuck. Here was the solution:
Fedora Core release 6 (Zod)The key sequence of Control and Right Bracket got me out of the Xen session, but kept me in the SSH session.
Kernel 2.6.18-1.2798.fc6xen on an i686
valhalla.terran.lan login: Ctrl-]
[root@baltar xen]#
Subscribe to:
Posts (Atom)
