Friday, January 11, 2008

cheap mac mini

Been a while since I posted - I've been snowed under with course work and then christmas so haven't been near much more than my laptops - which I try not to break to much as I need them to work.

I stumbled across an unloved 1.66 Core Duo mac mini in the bargain bin of a PCworld. It was missing a power supply and remote and was a base spec with 512mb/70gb with a cdrw/dvd rom drive, it is also a bit yellow - but was going for £200. I immediately decided against buying it as I already have to many computers. A couple of days later I was back buying the thing - my self control is useless. A PSU cost me £30 from play.com and 2gb of ram cost £32 from crucial. Someone supplied me with a 1.83 CoreDuo so that got put in at the same time.

I installed the last licence of Leopard from my families 5 pack of leopard licences. Leopard comes with front row 2.0. A much improved Front Row interface with the added bonus of being able to use the Saphire plugin to make browsing media better. I installed Perian and flip4mac QuickTime components to allow Front Row to play video encoded with pretty much any codec.

Next I need to hook it up to my nfs shares on my Solaris box and it can browse all of my media.

The really nice thing about using front row 2 is that it can connect to other machines in the house to read from itunes collections (like an AppleTV does) means that I don't have to sync my itunes library to the Mini.

I have a script that I'm working on to automatically rip DVDs on insertion using handbrake cli but its still a bit rough round the edges.


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