Thursday, May 1, 2008

Playing with Debian GNU/Hurd

Debian GNU/Linux is a great operating system. Debian provides deb package management, which IMHO is the best of any distribution of Linux. Debian also packages its operating system using GNU Mach as the kernel and runs the Hurd to manage the system. It was recommended by several sites that one use Debian GNU/Hurd, if you're a beginner. I am.

First, I decided to run Debian GNU/Hurd in qemu. For those not familiar with qemu, it's a x86 hardware emulator. I chose to use an emulator as I'm not sure what hardware I had sitting around that was compatible with GNU Mach and GNU Hurd. Debian GNU/Hurd actually provides a image file specifically for qemu, so it's easy to just jump right in. I just downloaded debian-hurd-k16-qemu.img.tar.gz from the site and untarred everything. Then I just ran qemu using this as the hard drive.


~# qemu -hda debian-hurd-k16-qemu.img


After running this command, I see the GRUB menu provided. I chose the first option


After booting, I login as root (login root) and I'm running the GNU Hurd. Woo hoo! Of course the first thing to do is configure networking. Following the guide at http://www.bddebian.com/~wiki/hurd/running/qemu/,
I try setting up the network.


~# settrans -afgp /servers/socket/2 /hurd/pfinet -i eth0 -a 10.0.2.15 -g 10.0.2.2 -m 255.255.255.0
/hurd/pfinet: eth0: (os/device) no such device
settrans: /hurd/pfinet: Translator died


Okay, now I was totally lost. They didn't mention this in the guide. First, I joined the Bug-Hurd mailing list. This mailing list is not directly related to the Debian project, but is found on the GNU Hurd website under Getting Help. After a quick description of my problem, I received an answer within several hours (I have always received feedback from this mailing list within 24 hours). Someone told me how I could find the problem. First, see if the ethernet card was detected.


~# devprobe eth0
~#


Alright, that was the first problem. The network card wasn't detected correctly. To figure out what exactly devprobe does, you can type: devprobe --help. Just FYI, the GNU Hurd doesn't use man pages at the moment--not sure if they ever will. Most programs, however, can provide usage information by passing the --help. After sending this information back to the person, who responded, he chewed me out for not replying to the whole mailing list. This is just another thing I've learned along the way. They don't like having private conversations. For one reason, problems like this that are sorted out on the mailing list are archived and can be searched later by people having the same problem. Thus problems are solved once and we're not reinventing the wheel. Don't feel bad about asking stupid questions (after looking through the documentation for a reasonable amount of time).

I was then told that my Linux distribution at the time, Ubuntu 7.10, used a version of qemu with a default NIC that was not supported by the Hurd. He supplied a flag to qemu that would use a supported NIC.

I now start qemu with the following:


~# qemu -hda debian-hurd-k16-qemu.img -net nic,model=ne2k_isa


After booting the Hurd now, running devprobe gives me the following:


~# devprobe eth0
eth0


Success! A NIC card has been found and assigned as eth0. Running settrans no longer gives an error.


# echo "nameserver 10.0.2.3" > /etc/resolv.conf


Supposedly that is all it takes to get network up and running. I do a quick ping of some website to see if it works.


# ping www.yahoo.com
-bash: ping: command not found


Drat! I find out through seaching ping does not come with the install and must be manually added. So I try installing a package.


# apt-get install lynx


I figure running lynx should tell me if I have internet access. The system recognizes the package and goes to fetch it. It seems to have trouble connecting to ftp.uk.debian.org. I ping it from my Linux distro and see the site is in fact running. I e-mail bug-hurd and decide to take a break. But the Hurd is now booting in qemu!

No comments: