kaashif's blog

Programming, with some mathematics on the side

Trying out DragonflyBSD

2017-06-22

So I was setting up a laptop I had just picked up, when it came to deciding what OS to install on it. Obviously, I'd probably end up installing some Linux and maybe also OpenBSD (hard drives are huge nowadays, I could fit hundreds of OSs on there). While I had tried out FreeBSD and NetBSD, DragonflyBSD had never been on my radar.

It still isn't, really, but I thought I'd try it out on an old laptop, just to see what it was like. It went pretty well, but there were a few oddities and one or two kind of weird design choices.

Getting installation media

I expected this to be a breeze, since all OSs offer all sorts of images. Dragonfly is no exception, on their downloads page, they offer a ISO for DVDs and a raw disk image, for USB disks. I went for the latter.

$ wget http://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-4.8.0_REL.img.bz2
$ bunzip2 dfly-x86_64-4.8.0_REL.img.bz2
$ sudo dd if=dfly-x86_64-4.8.0_REL.img of=/dev/sdb

This should work, but when I booted it up on my laptop, the bootloader screen came up, some kernel messages were printed, but then I got an error saying da8s1a (the root partition of the USB disk) was not found.

This was weird, so I typed the following:

mountroot> ?
da8
da0s1
da0s2

Uh, so apparently the USB disk doesn't have any partitions. I was not able to solve this problem, probably because all of my disks were bad - when I wrote the image to each of 3 USB sticks, each of them was different and none of them matched the actual image. I didn't manage to overcome this, so I just used the DVD image:

$ wget http://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-4.8.0_REL.iso.bz2
$ bunzip2 dfly-x86_64-4.8.0_REL.iso.bz2
$ sudo cdrecord dev=/dev/sr0 dfly-x86_64-4.8.0_REL.iso

Your device name may vary: the machine I'm doing this from is running Gentoo Linux, so the CDRW drive is /dev/sr0.

This disk booted and brought me to the installation menu without a hitch.

Installing

The menus were fairly pleasant and user-friendly. There's even a nice dragonfly logo behind the ncurses menu.

I was prompted about whether I wanted UFS or HAMMER. I've heard a lot of good things about HAMMER, so I went for it, mainly to see if it would break. It didn't break. I don't plan to use DragonflyBSD too much (since it's very close to FreeBSD, which I tried for a period of time and later abandoned), so this is the most I can really say.

I noticed that the partition layout was simple, just / (taking up 90% of the space), /boot, swap and something called /build taking up the rest of the space. I assume this is something to do with building from source, since it contains a usr.obj directory, and some other buildy stuff.

Something very strange was that I was not allowed to use any non-alphanumeric characters in my passwords. This means no ;'[]"! and so on. I cannot fathom why this is the case.

Also, the default shell is tcsh, which is just csh plus some things. It goes without saying that there are a lot of reasons not to use csh (at least ten). So this is less than ideal. We can change this later, so I wasn't too fussed about it at this point. But ugh, I hate csh.

Next, I was asked which network interface I wanted to configure. There were a ton of them, including faith0, sl0, ppp0, but I knew I was looking for em0, so there was no confusion here. For a beginner, it might be a bit weird that these pseudo-devices are enabled by default. I don't think many beginners install DragonflyBSD, though...

The rest of the installation (time zone, installing the bootloader, etc) was problem-free, so I just had to reboot and get cracking.

Using the system

Obviously I won't be using it long-term but I just wanted to confirm I was able to get everything set up with a minimum of pain.

The first order of business is to install X and some other stuff. I settled on Xfce, since it's so hassle-free to set up.

I realised that sudo wasn't installed (neither is doas from OpenBSD), so I tried su. I was prohibited from doing this, so I logged out and back in as root to install sudo. It's very simple:

$ pkg update
$ pkg install sudo

It already comes with package mirrors preconfigured and everything, so this is all you need.

Then I logged back in as kaashif and installed Xfce:

$ sudo pkg install xfce

After installing, I tried to run it with startxfce4, but I got complaints that xinit wasn't installed. And neither was X, actually! This is weird since I thought Xfce should depend on X.

$ sudo pkg install xorg xinit

Surely now X would run! No, I get an error that libssl.so isn't found. How is that possible? Anyway, I install libressl:

$ sudo pkg install libressl

And try again, but now I get a different error:

...
/etc/machine-id does not exist
abort
...

I thought dbus was supposed to make that for me. No matter, we can solve that:

$ dbus-uuidgen | sudo tee /etc/machine-id
$ startxfce4

And voilĂ ! It works! Except for the clit mouse...but I guess I can make do with a USB mouse.

Conclusion

You know, that wasn't too bad, I remember struggling with video drivers and monitor refresh rates and dreadful Xorg.conf files...things have really improved not just on Linux, but on BSD, too.

Not perfect, but I expected it to be a lot worse, given how few people use it. I guess that's the result of being a fork of the most popular BSD.