Sunday, April 23, 2006

war journal 012 - Ubuntu on OSX

(Updated) - The world turned upside down the past few weeks as Boot Camp went into full swing. And no they won't be joining the boys and girls in Iraq pretty soon, rather--- hell froze over and Windows once stuck in black, borning boxes could now reside on the stylish Mac hardware.

Dual booting has been around for years--- linux users have been booting windows in their boxes thanks to bootloaders like lilo and grub. now, Boot Camp is a similar tool--- essentially getting windows to boot on an intel mac. now as hackers have showed in the past few months, it takes a little bit of hack to pull it off. for one thing, the mac has no legacy bios to worry about--- which is problematic in that Windows lives in the archaic past and does not support (nor will Windows Vista) EFI. thanks to Apple, it can now be done.

Many people have tried boot camp and have successfully dual booted windows xp and os x--- you'd have to bring your own licensed copy of XP to the party though. Still, after years of being a Linux user, i've had my fair share of dual booting. And yes certainly it is very helpful to dual boot especially for that app that only exist in Windows that you couldn't live without and for the occassional games one might want to play. Take it from me--- six years of this dual booting thing is a hassle. Nothing is better than running on one single operating system or having another computer do that one other thing you might need it to do.

Now here comes the solution. Virtualization. It isn't new--- its been around (the technique anyway) since the day mainframes were king of the world. And there are many companies/organization that offer such solution--- VMware, Microsoft, Xen, OpenVZ but this upstart--- Parallels runs on OSX, among other things. You could for instance run, in near native speed, Windows XP side-by-side with OSX, and switch by just tapping on your keyboard.




Now, we've all seen and heard the promise that Virtualization has given. I have had numerous opportunities in the past to try it out, and at the end of the day, preferred to run my apps on a separate machine.

Still, its been years--- and the business has matured and everything else looks promising so why not give it a try? So I spent a week's Easter vacation running through hoops to get Parallels a shot. And after several failed attempts to get it to do what i want, like system crashes, did i just say that?

Parallels was finally running Ubuntu Linux beside my OS X. The choice of Ubuntu is simply to get one distro running in my experiment. Parallels has several options--- Windows, Red Hat, Suse, Debian and many others, though personally i'd love to put gentoo linux on this thing, but the lack of network support and the fact i crashed my mac several times doing it... i just wanted to get something to work. (Update) - Was able to get the networking stuff going by using dhcp--- though i still haven't been able to get it when i plug the mac direct to my adsl modem, i was able to do it by building a home-router-dhcp-linux box.



Man, it responds in near native performance, it even has sound to boot. The only thing I have problems with this and a lot of people, judging by the forum responses over at Parallels is having the same--- the lack of good network support. A guest OS still can't connect to the internet.



There are a few people over at the forums and over at Macworld who have done this using Windows. You might want to check them out, if you haven't already.

Now I'd like nothing more than to run Gentoo Linux on my iMac Core Duo--- it saves me a lot of trouble maintining just one single machine to do my testing and leave my server to stand as purely production and i'm sure the day will come when Parallels can get network support right and it will be an amazing thing!

Wednesday, April 12, 2006

war journal 011 - the case of parallels 2.1 beta and the crashing iMac

(updated)
a shadow suddenly fell on my iMac Core Duo, and a small black window in the middle of my screen appeared requesting i reset the system--- press the power button for a few seconds.


And i did.

what madness! i broke my mac! the horror! the insanity!

ok thats putting too much into it.

what happened?

quite simple really, i was playing with Parallels 2.1 beta. i downloaded it from their website--- hoping to test out the virtualization stuff. i of course don't have a licensed copy of windows (except the one that came with my laptop, which is not being used as it is running gentoo linux), so i opted to go gentoo, my linux distro of choice. all right the system was up. gentoo live cd booted all right. i had done what any gentoo user would have at that stage, setup lan, and made my partition.

so far so good.

fdisk went well. did my mkreiserfs /dev/hda1 and did my mkswap /dev/hda2 and ran swapon /dev/hda2

all great stuff.

then i mounted /dev/hda1 on /mnt/gentoo---- all normal, all doing fine.

now the next step is fetch stage3 tar balls. now, my style is to fetch the link from via links--- and save the stage3 tarball and a portage snapshot on /mnt/gentoo, then do the necessary untar as stated on the gentoo handbook. now normally i would be at tty1 so i did control+alt+f2 to switch to tty2--- then the black screen of death appeared!!!!



after the imac restarted, i logged on to my user account and a window was waiting for me. it was an error window, asking the error to be sent to apple. now i've been using linux for quite sometime and unix pedigree is really hard to crash. i mean, fatal crash that halts the entire system kinda thingy. so why a kernel panic?!

here is the text of what was sent to apple:

panic(cpu 0 caller 0x0034FC40): freeing free mbuf
Backtrace, Format - Frame : Return Address (4 potential args on stack)
0x1c723b08 : 0x128b5e (0x3bbeb8 0x1c723b2c 0x131bbc 0x0)
0x1c723b48 : 0x34fc40 (0x3db934 0x2e33bc00 0x1c723b78 0x2e276400)
0x1c723b68 : 0x34ffe7 (0x2e276400 0x312ecbf 0x6 0x2e276400)
0x1c723b88 : 0x6d9983 (0x2e276400 0xe 0x1c723bc8 0x1c723c38)
0x1c723bc8 : 0x1f7240 (0x3232004 0x2e276400 0x2 0x1c723c38)
0x1c723c28 : 0x227af5 (0x3232004 0x2 0x2e276400 0x41baa04)
0x1c723d68 : 0x232de5 (0x2e33bc00 0x0 0x0 0x2d503f0)
0x1c723dd8 : 0x3549e0 (0x32b8dd0 0x0 0x2e33bc00 0x4a0d604)
0x1c723e78 : 0x35932e (0x32b8dd0 0x4a0d604 0x3e38180 0x2e33bc00)
0x1c723ed8 : 0x3595ca (0x3e38180 0x0 0x37f46a0 0x0)
0x1c723f78 : 0x36d8e4 (0x39951f4 0x37f465c 0x37f46a0 0x0)
0x1c723fd8 : 0x197e7e (0x3996ef0 0x3996ef0 0x4a1000 0x1c723d0c) No mapping exists for frame pointer
Backtrace terminated-invalid frame pointer 0xbfffe008
Kernel loadable modules in backtrace (with dependencies):
com.apple.iokit.IONetworkingFamily(1.5.0)@0x6cf000

Kernel version:
Darwin Kernel Version 8.6.1: Tue Mar 7 16:55:45 PST 2006; root: xnu-792.9.22.obj~1/RELEASE_I386

Model: iMac4,1, BootROM IM41.0039.B00, 2 processors, Intel Core Duo, 1.83 GHz, 1.5 GB
Graphics: ATI Radeon X1600, ATY,RadeonX1600, PCIe, 128 MB
Memory Module: DIMM0/BANK 0, 1 GB, DDR2 SDRAM, 667 MHz
Memory Module: DIMM1/BANK 1, 512 MB, DDR2 SDRAM, 667 MHz
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x89), 103.2 (3.120.28.3)
Bluetooth: Version 1.7.3f4, 2 service, 1 devices, 1 incoming serial ports
Network Service: Built-in Ethernet, PPP (PPPoE), ppp0
Network Service: Bluetooth, PPP (PPPSerial), ppp1
Serial ATA Device: WDC WD1600JS-40NGB2, 149.05 GB
Parallel ATA Device: MATSHITADVD-R UJ-846
USB Device: Built-in iSight, Micron, Up to 480 Mb/sec, 500 mA
USB Device: Apple Optical USB Mouse, Mitsumi Electric, Up to 1.5 Mb/sec, 500 mA
USB Device: Hub in Apple Pro Keyboard, Mitsumi Electric, Up to 12 Mb/sec, 500 mA
USB Device: Apple Pro Keyboard, Mitsumi Electric, Up to 12 Mb/sec, 250 mA
USB Device: Bluetooth HCI, Up to 12 Mb/sec, 500 mA
USB Device: IR Receiver, Apple Computer, Inc., Up to 12 Mb/sec, 500 mA
other stuff--- intel virtualization (core duo has the intel-vt thing running and was active when parallels was running). i had several apps running (bon echo).

anyway going back to play with parallels now. will update when more news comes back. don't know though if i could figure out why this happened. i'd certainly like to know more about it. maybe will do a google on it.

UPDATE-1 well it happened again. well this time around was certainly my fault. i force quit parallels while it was running something. and i had iTunes running in the background etc. etc. i guess the system just had too many things on ram that it went crazy. anyway, there is an excellent forums for parallels here. seems my problems has occured before. sort of.

UPDATE-2 2nd panic log:

panic(cpu 0 caller 0x0019CAEF): Unresolved kernel trap (CPU 0, Type
14=page fault), registers:
CR0: 0x8001003b, CR2: 0x2e4b0000, CR3: 0x00d0e000, CR4: 0x000026e0
EAX: 0x2e4afff0, EBX: 0x1c4d3764, ECX: 0x03223c04, EDX: 0x4524a65a
ESP: 0x2e4b0000, EBP: 0x1c4d36f4, ESI: 0x2e4afffe, EDI: 0x00000022
EFL: 0x00010202, EIP: 0x4524a672, CS: 0x00000014, DS: 0x0000001c

Backtrace, Format - Frame : Return Address (4 potential args on stack)
0x1c4d3594 : 0x128b5e (0x3bbeb8 0x1c4d35b8 0x131bbc 0x0)
0x1c4d35d4 : 0x19caef (0x3c1340 0x0 0xe 0x3c10f8)
0x1c4d3684 : 0x197b53 (0x1c4d3698 0x1c4d36f4 0x4524a672 0x210048)
0x1c4d3690 : 0x4524a672 (0x210048 0x2e4a001c 0x312001c 0x1c)
0x1c4d36f4 : 0x1f720f (0x3959d80 0x3223c04 0x22 0x1c4d3764)
0x1c4d3754 : 0x20f9a0 (0x3223c04 0x22 0x2e4aff00 0x0)
0x1c4d3784 : 0x322e43d5 (0x3223c04 0x22 0x2e1c6100 0x0)
0x1c4d37c4 : 0x322e6a08 (0x3223c04 0x2e1c6100 0x3218a32 0x8864)
0x1c4d3814 : 0x322e6afc (0x3218804 0x2e1c6100 0x3218a32 0x8864)
0x1c4d3844 : 0x322e737a (0x3218804 0x2e1c6100 0x3000000 0x26ebd670)
0x1c4d3884 : 0x322001ea (0x35a9504 0x2e1c6100 0x2da2e80 0x1c4d38c8)
0x1c4d38b4 : 0x321feb89 (0x35a9504 0x2e1c6100 0xf5fc628 0xb36)
0x1c4d3904 : 0x321fee27 (0x3453a04 0x2e1c6100 0x1c4d3924 0x19ba56)
0x1c4d3964 : 0x321ff060 (0x3453a04 0x2e1c6100 0x1 0x3453a04)
0x1c4d39c4 : 0x1f7240 (0x3453a04 0x2e1c6100 0x304db94 0x1c4d39ec)
0x1c4d3a24 : 0x227af5 (0x3453a04 0x2 0x2e1c6100 0x37c9f04) Backtrace
continues...
Kernel loadable modules in backtrace (with dependencies):
com.apple.nke.pppoe(1.4)@0x322e3000
dependency: com.apple.nke.ppp(1.4.1)@0x321fc000
com.apple.nke.ppp(1.4.1)@0x321fc000
com.parallels.kext.Pvsnet(2.1)@0x45248000

Kernel version:
Darwin Kernel Version 8.6.1: Tue Mar 7 16:55:45 PST 2006;
root:xnu-792.9.22.obj~1/RELEASE
_I386

Model: iMac4,1, BootROM IM41.0039.B00, 2 processors, Intel Core Duo,
1.83 GHz, 1.5 GB
Graphics: ATI Radeon X1600, ATY,RadeonX1600, PCIe, 128 MB
Memory Module: DIMM0/BANK 0, 1 GB, DDR2 SDRAM, 667 MHz
Memory Module: DIMM1/BANK 1, 512 MB, DDR2 SDRAM, 667 MHz
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x89),
103.2 (3.120.28.3)
Bluetooth: Version 1.7.3f4, 2 service, 1 devices, 1 incoming serial ports
Network Service: Built-in Ethernet, PPP (PPPoE), ppp1
Network Service: Bluetooth, PPP (PPPSerial), ppp0
Serial ATA Device: WDC WD1600JS-40NGB2, 149.05 GB
Parallel ATA Device: MATSHITADVD-R UJ-846
USB Device: Built-in iSight, Micron, Up to 480 Mb/sec, 500 mA
USB Device: Apple Optical USB Mouse, Mitsumi Electric, Up to 1.5 Mb/sec, 500 mA
USB Device: Hub in Apple Pro Keyboard, Mitsumi Electric, Up to 12 Mb/sec, 500 mA
USB Device: Apple Pro Keyboard, Mitsumi Electric, Up to 12 Mb/sec, 250 mA
USB Device: Bluetooth HCI, Up to 12 Mb/sec, 500 mA
USB Device: IR Receiver, Apple Computer, Inc., Up to 12 Mb/sec, 500 mA
* * *

anyway, i just emailed the two panic logs to parallels and hope they find a solution to it. :)

Saturday, April 08, 2006

war journal 010 - Parallels 2.1 and Xen 3

parallels is a desktop virtual machine solution for Mac OS X. i installed it on my 17" Core Duo iMac with 1.5GB RAM, 160GB Hard Drive. i was able to create a virtual environment for linux 2.6. i downloaded a gentoo 2006.0 mini cd. parallels was able to boot it with some minor adjustments: i set it so that the vm would use the physical (super)drive.

gentoo booted very well. though i did notice that my machine is designated as celeron-a, 2.7 ghz. i allocated 512MB ram to the machine. i have activity monitor in the background to monitor system performance. needless to say, i had 0% idle time on the real machine while using parallels.

parallels is registered compiled for intel. and i had several apps in the background including my browser which is designated as powerpc. this is bon echo.

anyway--- back to parallels-gentoo. i reached to command prompt the problem now is, parallels has the network as "bridge" now i have to figure out how to set the network card in that regard on gentoo. i'll try to do that tomorrow.

all in all, parallels is a very easy thing to setup. i did it under 5 minutes. so far so good.

in other news, was able to get xen to run domain 0 on my gentoo amd64 linux box. i have yet to compile a kernel for domain 1... which i'm having problems running. i think its just a matter of getting the configuration properly. i did notice a system slowdown (slightly sluggish running gnome on domain0), since the box is now running xen on domain 0, probably because everything passes through the hypervisor. when executing top on domain 0, you could see that the system had already lost ~256mb--- from 1024mb.

so far those have been my observations.