Thursday, November 29, 2007

xVM Windows XP Hosts

I'm still playing around with xVM under build 76 of solaris though as I type build 77 is out to the general public.
I bought some more memory for my system to take it to 4GB to give me some head room to play with domUs, ZFS and SunRay only to find that my BIOS doesn't properly support 4GB. Currently the OS can only talk to 2900 or so MB - the rest has been appropriated by the BIOS. Now of course this being a 64bit OS the 32bit limitations don't apply - unfortunately the BIOS has no memory remap option for 64bit aware OSs I think the chipset does support it as far as I can tell but it looks like ASUS have not implemented it in the V3-P5945G BIOS - most annoying. I've ordered a new mainboard which should do the trick(at least if the BIOS manual I read is to be believed) When that turns up I will reinstall with build 77 - I'm hoping that my problems with biosdev might go away - but I'm not convinced.

Mainly I followed this guide for setting up my HVM domU but with a couple of bits and bobs I have gleaned from the very useful xvm-discuss@sun.com mailing list and the Release Notes have helped me get my XP domU up and running.

6612343
Setting:
set softcall_delay=0x100000
in /etc/system

and

root@frank / $ svccfg -s xvm/xend setprop config/default-nic="e1000g0"
root@frank / $ svcadm refresh xvm/xend
root@frank / $ svcadm restart xvm/xend

To confirm:

root@frank / $ svccfg -s xvm/xend listprop |grep default
config/default-nic astring e1000g0


to make sure it gets the correct network card (I now have two physical cards instead of two vlans to one card after working around my SunRay latency issue)

I also put this in my .hvm file to bridge the interface.

vif = ['mac=0:1b:21:4:b9:1, bridge=e1000g0']

Running the domain
root@frank xVM $ xm create windows-xVM.hmv

Then just vnc to the console, annoyingly Apples screen sharing vnc application doesn't work for connecting to the console session of a dom. Though this is almost definitely a limitation of the client not the server, as most other clients seem to work fine. On the Mac JollyFast VNC seems to be the best free client, vineViewer was a bit nicer but isn't free. vncviewer on Solaris works well as does xtightvncviewer on Ubuntu.

The install was not without some hitches - seemed to hang up and if I didn't have the vnc session open when it prompted for input the domain would get blocked, and I couldn't get back onto the vnc session. Installaition did take a while longer than expected as well.

I'm going to try and dig out some windows server disks at some point as well and give them a go to so I will try and monitor the performance more closely issues then.

Monday, November 19, 2007

Using Live Upgrade to move disks on x86 with a difficult bios

I'm attempting to move my disks around in my OpenSolaris Box - I have a pair of IDE 120Gb which at one point where mirrored using SVM - but I want to use them in another side project so I need to migrate my install from one IDE disk to the space I have left on the pair of SATA drives where my ZFS pool is (there is space left as I did at one point boot from the SATAs before I reinstalled to the IDEs)

First lucreate for a new BE
root@frank / $ lucreate -c b76a-ide -m /:/dev/dsk/c1d0s3:ufs -n b76a-sata

The lustatus to check whats going on:

root@frank / $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
b76a-ide yes yes yes Yes -
b76a-sata yes no no no -
root@frank / $

Excellent so I have a identical but relocated boot environment I can use - let luactivate it.

root@frank / $ luactivate b76a-sata



Saving latest GRUB loader.

Setting failsafe console to .

ERROR: No matching BIOS id found for:


ERROR: Cannot determine GRUB id for ABE disk

ERROR: Unable to determine the configuration of the target boot environment .

root@frank / $

Dam - I've hit this problem again. It seems to resolve around the way /sbin/biosdev reports my disks:

root@frank / $ sbin/biosdev

0x80 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0

0x81 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0

root@frank / $


These two disks are my IDEs - but I want to boot off the first SATA disk.

I'm not sure if this is a limitation of my BIOS or a problem with biosdev but what I have done is: (Ugly Hack time).
To get luactivate to work I need to cludge /sbin/biosdev to output something that will work.

I used the output of /sbin/biosdev -d to produce this

root@frank / $ cat /sbin/biosdev
#!/bin/sh
echo "0x80 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0"
echo "0x81 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0"
echo "0x82 /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0"
echo "0x83 /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0"
exit 0
root@frank / $

I installed grub on the other disk manually, specifying the slice solaris is on

root@frank / $ installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s3
Solaris boot partition inactive.
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 260 sectors starting at 50 (abs 16115)
root@frank / $

Then I mounted the new BE and copied menu.lst from my active boot enviorment on the IDE disk to the new SATA disk.
root@frank / $ lumount b76a-sata
/.
alt.b76a-sata
root@frank / cp /boot/grub/menu.lst /.alt.b76a-sata/boot/grub/menu.lst

Unmount the new BE and activate
root@frank / $ luumount b76a-sata
root@frank / $ luactivate b76a-sata

reboot and catch the bios and change the disk order to boot from the SATA disk.

Because the system is now hopelessly confused (a bit like me) about which disk is where so my /boot/grub/menu.lst was quite wrong it was attempting to use (hd3,0,d) as my boot slice for the sata dissk so I had to edit it manually at boot to point to (hd0,0,d) - and then once again edit the /boot/grub/menu.lst to match.

The reason for this editing is that I changed the order the disks are chosen from within the bios as otherwise it will continue to boot from the first IDE disk. Basically once the system comes up from the sata disk if I run the original biosdev i get this:

root@frank / $ /sbin/biosdev
0x82 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0
0x83 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
root@frank / $

Which are the SATA disks. lustatus shows the correct information as well now.
root@frank / $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
b76a-ide yes no no yes -
b76a-sata yes yes yes no -

At this point I pulled the IDE disks from the machine (ludelete is also confused because of incorrect biosdev info so wont delete them.) Though I forgot to fix my swap partition and the system failed to boot until I sorted that out. A quick vi session in /etc/vfstab to change the swap partition and the clear the error using svcadm:

root@frank / $ svcadm clear svc:/system/filesystem/local:default

There is some more fiddling to do in /boot/grub/menu.lst to fix the xVM entries and some nasty undocumented mucking around in /etc/lutab to remove the old ide entries but finally I'm back where I started but with a couple of IDE disks to play with ZFS on my mac. (now I need to find some IDE USB caddies)

As I side note I've finally found a use for the PIP (picture in picture) function on my Dell 24 Pannel - I attach a S-Video cable to the output of my graphics card so that I can fiddle with the bios on the server without swapping inputs - though serial redirection in the BIOS would be nicer.

I really miss OBP.

Friday, November 16, 2007

VLAN for the SunRay interconnect and performance issues

The Sun Ray in the living room has been getting terrible performance - its connected via a NetgearGSM7224 gigabit switch to my OpenSolaris box running build 76 which I recenlty upgraded with a new e1000g intel Gigabit NIC. utcapture was reporting 30% packet loss in some cases - which equates to bad performance.

So I've done a bit of tweaking and the SunRay and the Server now have a dedicated VLAN to themselves.

Its worth nothing that I did this via a serail console - network reconfiguration is hard to do over ssh unless your careful about the order you do things in!

Firstly I configured the switch - it has a gui or a cli but I was feeling lazy and used the gui.

Port24 (my servers port) is now tagged with vlan IDs of 999 and 1 (the default vlan)
Port7 (the sunray) is marked untagged as vlan ID 999

On the solaris box you can bring up vlan aware interfaces using
ifconfig e1000g1000 plumb 192.168.2.252 up
gives a vlan ID of 1
ifconfig e1000g999000 plumb
gives a vlan of 999

though if you want it permanently (like I do) you need to put the ip address in
/etc/hostname.e1000g1000
Though as I'm always going to need interfaces with tagged vlans to use the switch port from now on I will just move the files:
mv /etc/hostname.e100g /etc/hostname.e1000g1000

Next step is to setup the Sun Ray interconnect.

As my dns setup is somewhat lacking (its on the list) I had to set my /etc/hosts file to point my machine at my IP adress not the loopback 127.0.0.1
utadm seems to do a getent hosts and refuses to work untill this is configured correctly.
root@frank sbin $cat /etc/hosts
192.168.2.252 loghost frank

Using the manual I configured the SunRay interconnect for the pre-plumbed e1000g999000 VLAN aware interface.
root@frank sbin $ /opt/SUNWut/sbin/utadm -a e1000g999000

The defaults where fine for me in this case so I just hit Y to confirm and let it do its stuff.
and the system should configure a DHCP server running on your new vlan interface.

After that - the Sun Ray was up and running correctly - though not quite as quick as I feel it should have been. utcapture was still listing 30% packet loss on a regular basis

A bit of further investigation (google) found this forum posting. It seems to suggest that UDP traffic might be getting dropped by the switch because it can't send it to the SunRay fast enough. After playing around with the settings on the switch I discovered that setting the server switch port to 100 Full Duplex massively reduces the packet loss observed using utcapture.
The next stage will be to try a different network card and maybe a different switch for the SunRay interconnect to see if I can get better performance for the SunRay and still keep the Gigabit speed connection for my main connection to the server. I'll keep reading up on the switch to see if their is a way to adjust the way it handles UDP packets - but its only a Level 2 Netgear so I'm not convinced.

Thursday, November 8, 2007

Leopard 10.5 Notes

Adding OPML feeds to mail is not possible (at least not though an import opml import option) it can be done, but to put them all into a nice ordered way just seems like so much hassle compared to leaving them in Vienna!

It looks clean and crisper somehow - I guess thats the unified thing for you.

The Dock is annoying - the icons on the right are broken, they default to the first icon in the containing folder not the folder itself - just moronic. The active application white dot is hard to see on the reflective dock - and I'm not keen on the background reflection thing, I'd prefer the dock on the side in look if not function. I'm also used to long right clicking the icons to bring up a menu - with stacks its now a left click...

CoverFlow in the finder might actually be useful for the hundreds of .doc file my university bombards me with for every single communication.

Tabs in the terminal are ok, I prefer the shortcut for moving between them (Command + }/{) over gnome-terminals ctrl+PgUp/PgDwn. Still no middle click paste like X11 (hey I can dream)

NFS Network drives no longer seem to mount on the desktop - so not sure how I make alias for playing network content through front row just yet... alias or ln -s isn't working. But making an alias of a folder within the mount and moving t
hat to your movie folder seems to work. Front row is much better more responsive, and movie preview icons seem nice though they are no longer moving, which may be why its more responsive. Whenever you enter Front Row iTunes stops whatever its playing - random and annoying.

Finder overall seems snappier to me. (about time!)
ZFS read is here (not tested) - allegedly the beta
 ktexts where available from Apple Dev Connection
 at one point even apples command line prompt says so! - my brief search couldn't find them.

Wednesday, November 7, 2007

wpa_supplicant Uni Wifi

I worked out how to use wpa_supplicant on Ubuntu to do 802.1X authentication at University on my x40 ThinkPad.

It's just a case of getting it all in the right order and getting the CA certificate from somewhere (I exported mine from my Mac under OS X which of course - justs works)
The crucial bits that took me a while where putting ap_scan=0 outside of the network brackets. Now I think about it its obvious thats its a global option but I didn't notice it in the manual. This allows the driver to do the scanning of SSIDs as apposed to wpa_supplicant - the secure uni network is hidden and without this debug output indicated that it was not finding the network. Also for my network I think I have to ensure that I use phase1="peapver=0" I worked that out when I was getting my Nokia E61 running Symbian to working on the same network.

my wpa_supplicant file now looks like this:

burt@bobby:/etc/wpa_supplicant$ cat wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ap_scan=0

network={

ssid="SHU-USS"

key_mgmt=WPA-EAP

eap=PEAP

identity="myusername"

password="password"

ca_cert="/home/burt/certificates/myunicertifcate"

phase1="peapver=0"

phase2="auth=MSCHAPV2"

}


and after that I just start up wpa_supplicant
burt@bobby:/ sudo wpa_supplicant -Bw -ieth1 -c/etc/wpa_supplicant/wpa_supplicant.conf

and then getting a dhcp address:

burt@bobby:/etc/wpa_supplicant$ sudo dhclient eth1



Now I have this working I might think about trying to work out what keep causing nm-applet (the default way of managing to wifi in ubuntu 7.10) to fall over after connecting to the network if I can find the time. For the moment it works and thats what I care about. I get to stay in Linux for longer - which on this laptop is much faster and much as I hate to sound like a fanboi works better than Windows (for my uses) a large amount of the time (wpa Enterprise networks apart).

Update:
Interesting gotcha - wpa_supplicant seems to only work after I run it up with ap_scan=2 in the wpa_supplicant.conf file (which fails) then change it back to ap_scan=0 and run up wpa_supplicant again. - this is after the x40 has been in hibernation.

Friday, November 2, 2007

permissions and gnome font cache

I managed somehow to break the permissions on /var/tmp on my OpenSolaris box.

I was messing with my users primary groups (and not paying enough attention or making
ing enough notes)

this causes a few issues for gnome and cde failsafe - ie you cant log in and non
root users couldn't even get a failsafe session.

I fixed that, ran gnome-cleanup and tried again cde and failsafe where ok for all
users but, still no gnome goodness
Why do I want gnome for my server? - because I'm thinking of putting a Sun Ray in
the front room - its nice to have google and wikipedia to settle arguments in the house.

Anyway - back to my gnome problem - logs is what I need.

I enabled logging for my user in my $HOME/.dtprofile by changing this line:
export dtstart_sessionlogfile="/dev/null"

to point to /tmp/mydtlog
don't forget to touch the file to create it.

tailing the file on login I was getting segfaults and coredumps when Xsession launched

after some googling, and then some opensolaris searching I eventually found this post

Which while not quite what I was experiencing made some sense to me I remember we had similar problems on our Sun Ray servers in the labs before thought that time Wilson fixed it! so I ran:

root@frank / $ find /usr/openwin/lib/X11/fonts -name fonts.cache-1 -exec {} \;
root@frank / $ fc-cache -s

Volia - all is well!

gnome is back for my user and it works for root correctly now as well

Thinkpad x40 Ubuntu Linux


Some notes on how I setup Linux on IBM/Levano ThinkPad X40

Backing Up System Restore Partition

The system came with no disks (I don't think they do even if new) but does come with a system restore partition.
I decided I would like to be able to restore the system to a 'blank' windows state at a later time if I wanted to sell the laptop.

The system allows for the making of backups using a utility under All Programs -> ThinkVantage -> Create Recovery Media.

As I didn't buy a docking station for the system I have no cd rom drive but I decided against using a usb hard disk to back the partition as I didn't really want to dedicate yet another disk to permanent storage, its bound to fail or get wiped by accident. So I used a LaCie USB 3.5 disk caddy connected to an old cd burner. It's only USB 1 ports but seems to do the trick.

This is just a recovery option, so I also used the build in rescue and recovery software to make a backup of the system as it was then copied that back to my macbook pro to burn to dvd.

Testing the backups: boot from the recovery cdrom to check it works correctly (hit f12 at boot)

I was going to install across the network, but since I have a cobbled together cdrom drive I didn't bother.
Ubuntu 7.04 text install boots ok from the cd drive, but then fails to work out what cdrom drive module to use
selecting cdrom from the modules list and entering /dev/scd0 worked for me

Resizing partitions - I used guide resize and selected 20gb to resize to and hoped that it wouldn't blat windows or the system restore partition
(not the end of the world if it did - but would be annoying to have to restore.)

After it was installed I updated it to 7.10 using update manager and all is good.

One minor fix to the behavior of the Fn + F5 button was found in bug 152217

I'm still investigating some odd behavior with the wireless nm-applet and some scary stories about aggressive power management parking the disk to often.
But apart from that the system is great under ubuntu even with 768MB Ram and a 1.5 Pentium Mobile. I carry it most places as it weighs almost nothing even with the larger 8Cell battery sticking out the back.

xVM Solaris and how I can break stuff.

My forays into xVM (xen for OpenSolaris) in build 75 of OpenSolaris are causing me one or two minor issues.

Firstly I hit:

* 6616311 Live upgrade does not add entry for xvm in grub menu.

There is no xVM entry in /boot/grub/menu.lst.

Workaround:

Run bootadm -m upgrade and reboot the system.

Looks like live upgrade doesn't quite do all the bits needed for xVM just yet.
Unfortunately this didn't work for me, and I ended up having to edit /boot/grub/menu.lst manually to add the following entry's:
title Solaris75a on xVM
root (hd2,0,a)
kernel$ /boot/$ISADIR/xen.gz
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/uni
x
module$ /platform/i86pc/$ISADIR/boot_archive

title Solaris75a on xVM - via serial console shared
root (hd2,0,a)
kernel$ /boot/$ISADIR/xen.gz console=com1 com1=9600,8n1
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/uni
x -B console=hypervisor
module$ /platform/i86pc/$ISADIR/boot_archive

title 32-bit Solaris75a on xVM
root (hd2,0,a)
kernel /boot/xen.gz
module /platform/i86xpv/kernel/unix /platform/i86xpv/kernel/unix
module /platform/i86pc/boot_archive

Though it took me far to long to work out that I had forgotten the root(hd2,0,a) lines the first time.

After that I added:
serial --unit=0 --speed=9600
terminal --timeout=2 serial console

to enable me to select the grub menu option down a serial line (connected to a wrt54g - which is part of my Final Year Project)

The system booted into xVM with a shared serial console with Solaris.

I attempted to create a DomU instance of Windows2003 using a zfs raw disk however during the process the system appeared to lock up hard, I didn't have the serial line attached at the time of the lockup so have no idea what actually whent on - suffice to say it fell of the network and wasn't repsonding to the console (serial and/or keyboard and monitor).

After a while I got board of waiting and reset the box (I get impatient like that) - it seemed to come back up ok - but now whenever it boots it seems to panic when loading dtterm (this box is also a sunray server). I can get it to boot into plain build 75 but whenever I attempt to use the xVM menu it panics again.

I'm not entirely sure if I have mangled something by hard powering the system off or not but for the moment I'm going to boot back to my old build 64 BE and create a new BE based on that and attempt to try again - annoyingly ZFS has been upgraded since build 64 so I can't get to my home dir.

At this point I fiddled fruitlessly for a while before attempting a reinstall only to have the what appears to be the same problem - panic when it gets to the graphical login.

So on the new install I tried disabling graphical login in - as it always seemed to fall over at that point - I also edited grub to give me serial console again (don't forger to remove the splash screen option)

I can now boot into xVM with solaris as Dom0 - but no graphics

I've just come back to this after a while (now on a clean install of build 76) and have located the source of the panics under xVM when xorg loaded it appears to be issues with the shared memory of the intel 950 GMA. This was only located with a bit of help from opensolaris forums and one very helpful mrj at Sun its bug 6624364.
I'm working around the issue by using an ancient ATI card - I only have a head for occasional debugging purposes as I use the serial line for remote access but this being x86 it needs graphics of some sort to boot It's a sunray server I need so I do need x to load - maybe you can configure xorg not to come up on the console and only for use on sunray sessions but I don't know how.

But the long and the short of it is I've booted windows in a domU HVM using xVM.

I've been using zfs raw images for the disk though as I havn't got it installed yet I haven't been able to experiment with ZFS snapshots for rolling back purposes.

The problem is of course that I can't find any Windows MSDN CDs or iso images that my Uni kindly supplies me with to go with the MSDN license keys I have! still the ISOs I do have boot and I can get to the stage of entering license keys.

At some point I intend to try putting a Linux domU on as well - its just a matter of finding the time.