freebsd

Testing stuff with QEMU - Part 3: Debian GNU/kFreeBSD

Debian GNU/kFreeBSD screenshot 1

Note: This article is part of my Testing stuff with QEMU series.

From the Debian GNU/kFreeBSD port page:

Debian GNU/kFreeBSD is a port that consists of GNU userland using the GNU C library on top of FreeBSD's kernel, coupled with the regular Debian package set.

Q: Why would anybody want to do that?
A: Why not? [1]

So, after we have talked about that, let's start:

  1. Install QEMU:
    apt-get install qemu
  2. Download the latest Debian GNU/kFreeBSD installer ISO image (either for i386 or amd64):
    wget http://glibc-bsd.alioth.debian.org/install-cd/kfreebsd-i386/20070313/debian-20070313-kfreebsd-i386-install.iso
  3. Create a QEMU image which will hold the Debian GNU/kFreeBSD (i386) installation:
    qemu-img create -f qcow2 qemu_kfreebsd_i386.img 5G
  4. Boot directly from the ISO image and install Debian into the QEMU image:
    qemu -boot d -cdrom debian-20070313-kfreebsd-i386-install.iso -hda qemu_kfreebsd_i386.img
  5. The FreeBSD installer will now start. For more detailed instructions see the Installing Debian GNU/kFreeBSD manual.
    First you can choose between an "Express" or "Custom" install (I used "Express").
  6. Next you end up in the partitioning tool. Type "a" to use the entire (QEMU) disk for the installation (the disk is called "ad0", not "hda" as on Linux). Type "q" to quit the partitioning tool.
  7. You are now asked which boot manager to use. For QEMU you should use "BootMgr", the default FreeBSD boot manager. If you install on real hardware you can also use GRUB; in that case choose "None" here (see the manual for more information), but note that the installer does not install or configure GRUB for you! You should do that beforehand!
  8. Next up: The disklabel editor. Here you'll create a partition ("slice" in FreeBSD-speak) for the root filesystem and a swap partition.
    Press "c" to create a new slice (will be called "ad0s1"), enter "4GB", choose "FS" (filesystem), and enter "/" for the root filesystem. Per default the UFS2 file system will be used. To create the swap partition, press "c" again, enter "1023MB", and select "swap". The new slice is called "ad0s1b". Press "q" to quit.
  9. Choose "minimal" when asked which distribution to install.
  10. Installation media dialog: select "CD/DVD" and "acd0" (for QEMU's ATAPI/IDE CD-ROM drive).
  11. The installation will now begin, and after a while you're asked to switch to console 3 using ALT-F3. Do it.
  12. You'll have to answer a bunch of questions: geographic area + city you're in (for timezone), whether you want to participate in the Debian popularity contest, whether module-init-tools should load additional drivers (no, so press ENTER three times). The installation will soon be finished.

At the end you must select "No" as you're told to do, then reboot via "Exit Install". You can then shutdown QEMU.

  1. Restart QEMU with the newly installed Debian GNU/kFreeBSD:
    qemu -hda qemu_kfreebsd_i386.img
    Debian GNU/kFreeBSD screenshot 2
  2. Press enter at the FreeBSD boot manager prompt, then login as root (there's no password).
  3. First things first: Set up a root password:
    passwd
  4. Now let's fix networking, update the system and install a bunch of packages:
    nano /etc/network/interfaces
    Yes, there's no vi, not even a symlink to nano! Uncomment the two "ed0" lines ("ed0" is the equivalent to "eth0" on Linux, I guess).
    /etc/init.d/networking restart
    apt-get update && apt-get dist-upgrade
    apt-get install vim xorg icewm xterm
  5. You can fix your console keymap using the kbdcontrol package (just select your keymap from the menu):
    apt-get install kbdcontrol
  6. Finally, let's fix X11 and start it. But first we create a new user, as we don't want to run X11 as root:
    adduser uwe
    vi /etc/X11/xorg.conf
    The mouse device is "/dev/psm0", the protocol "PS/2", and the graphics driver should be "vesa":

      Section "InputDevice"
          Option "Device" "/dev/psm0"
          Option "Protocol" "PS/2"
      [...]
      Section "Device"
          Driver "vesa"
        
  7. That's about it. Login as "uwe" (or whatever your username is) and start X11:
    startx

Wasn't all that hard, eh? Now, if you've got some spare time, head over to the Debian GNU/kFreeBSD wiki page and help improving this port ;-) You should probably start with reading the PORTING guide.

Both kfrebsd-i386 and kfreebsd-amd64 seem to be reasonably stable already (and more than 70% of the whole Debian archive builds fine on these architectures, see kfreebsd-i386_stats and kfreebsd-amd64_stats). I'll quite likely install kfreebsd-amd64 on one of my boxes soonish and start using it, maybe I'll even find some time to fix/patch/port some packages...

[1] More elaborate answer(s) and reasons are available in the Debian wiki.

OS Install Experiences - Part 3: PC-BSD [Update]

Note: This article is part of my OS Install Experiences series.

I'll continue with the recently released operating system PC-BSD 1.1, which is based on FreeBSD 6.1.

This is actually the first time I installed a BSD-like OS, so I thought it would be a bit of a hassle. But I was surprised to find that the install was really pretty easy (which is a major goal of PC-BSD, as I understand it). I didn't even read a manual or installation instructions or anything...

Install

  1. First, I downloaded a PC-BSD 1.1 CD #1 image, burned it on a CD, and booted from that.
  2. The first installer screen is text-based (later it's graphical), and allows you to choose between a normal install ("boot FreeBSD"), install "with ACPI", "safe mode", "single user mode", and "with verbose logging". You can also "escape to loader prompt", or "reboot".
  3. While the installer runs, it merely shows a nice desktop background, pressing any key shows you the boot messages.
  4. After a while you can select a screen resolution for the graphical installer, run fdisk, escape into an "emergency shell", chroot into the root partition, or reboot. Default is to start the installation at a pre-selected screen resolution.
  5. You can choose the language and keyboard layout. Although you can click "back" to return to previous steps in the installer, you can not go back to the language/keyboard selection later!
  6. Partitioning. First, you can choose on which disk to install, then choose the partition to use. The list only shows the primary partitions and an "extended DOS" partition. Device names for disks are a bit different in BSD world. /dev/ad0 (counting starts at 0) is the first disk, /dev/ad0s1 (counting starts at 1) the first "partition" (called "slice" in BSD). It doesn't seem to be possible to install PC-BSD on an extended partition (please correct me if I'm wrong), so I installed it on /dev/hda2 (/dev/ad0s2 in BSD-speak), which is a primary partition. To make things more complex and confusing, a BSD slice can contain multiple "partitions" (not the same as Linux partitions!). I now have /dev/ad0s2a, which is the boot partition, and /dev/ad0s2b, the swap partition. Confused? Me too.
  7. Note that changes made to the partition table seem to be effective immediately, there's no way to go back without losing data! Debian's installer is better at this. The default PC-BSD file system is UFS, btw.
  8. The hardware will be automatically detected (worked quite well for me).
  9. You can now choose to either install the BSD bootloader in the MBR, or install no bootloader at all. Not sure what the best thing for me is here, but I decided to install the BSD bootloader (overwriting GRUB). I might have to re-install GRUB (and tell it about PC-BSD) if the BSD bootloader cannot boot the other (Linux) OSes.
  10. Now I must enter the root password, and I can also create another user. I noticed that passwords can only contain alpha-numeric characters (no %$§,.#+!? and so on). WTF? They can't be serious... Also, you must enter a real name for the normal user, it won't let you continue until you type something... Pretty annoying. There's a checkbox called "Auto-Login User?" which is enabled by default, but I didn't find out what exactly that does...
  11. The network is successfully auto-configured via DHCP. I was not asked for a hostname, but typed hostname after the install and I got PCBSD.localhost.
  12. Reboot. The CD is not ejected automatically, you have to remove it manually before booting up.
  13. I'm asked to insert CD 2 (language packs), which I don't have (or want), as I only burned CD 1. Clicking "abort" does the trick, and I can continue with English as the default language.
  14. Finally, I'm dropped into a KDE session, and that's it.

Security

Continue reading here...

Update 2006-06-02: Added IPv6 netstat/sockstat output.
Update 2006-06-02: Shortened the length of the article on my main webpage as well as the RSS feed. But you can always read the whole article here, of course.

Syndicate content