I’ll start this off with a disclaimer: this post is really more for my own benefit than the benefit of anyone else.
OpenBSD is my OS of choice when it comes to setting up a quick, simple UNIX-based virtual machine (VM). Need a virtual firewall? Use OpenBSD. Need a router? Use OpenBSD. Need a web server or an FTP server? Use OpenBSD. Need to run some network security tools? Use OpenBSD.
The problem is this: once I get an OpenBSD system up and running, it runs so well that I rarely have to go set up another one. Because there is then this length of time between installations, I always find myself forgetting the steps to take when installing an OpenBSD system. Thus, the need for this post and why I say it’s really for my benefit more than anything else. Next time I need to install OpenBSD in a VM for some reason, I can quickly come back and reference my list. (I will say that the installation of OpenBSD in recent versions has gotten much simpler than it was in the past.)
Oh, another disclaimer is probably necessary here, too: this is not to be considered some sort of “best practices” guide, so please don’t hammer the comments with stuff like “You know, you really should…”. This is just a quick and simple setup.
With those disclaimers out of the way, here’s the installation procedure. This was written for use with OpenBSD 4.6:
- Boot from the OpenBSD installation ISO image. When prompted, choose “i” to install.
- Press Enter for the default keyboard layout (unless you need a different layout, naturally).
- Enter the system’s hostname in short form.
- Enter the name of the network interface to configure. When installing on VMware Fusion 3.0.2 on my Macintosh, the default interface is
em0. On VMware vSphere 4, the default interface isvic0. - Enter the IPv4 address or press Enter to use DHCP.
- Enter the IPv6 address or press Enter to not assign an IPv6 address.
- Press Enter to complete the configuration of network interfaces.
- Press Enter not to perform any manual network configuration.
- Enter and confirm the root password.
- Press Enter to start
sshdby default. - Press Enter not to start
ntpdby default. - Enter “no” to indicate that you will not be running the X Window System.
- Press Enter not to change the default console to
com0. - Press Enter not to create an additional user. (I generally prefer to create an additional user after installation is complete.)
- Press Enter to accept the default disk as the root disk. On my Mac running VMware Fusion 3.0.2, the default disk is
wd0. - Press Enter to use the whole disk.
- Press Enter to use auto layout of partitions on the disk. (I’m not sure what version of OpenBSD added this feature, but it is quite handy for simple installations.)
- Press Enter to use the CD to install the sets. The CD in the VM should be mapped to the ISO image of the OpenBSD 4.6 install CD.
- Press Enter to use the default CD (which showed up as
cd0on my system). - Press Enter to use the default path to the sets.
- Remove the X Window System sets by entering “-x*” and pressing Enter.
- Verify that the X Window System sets (
xbase46.tgz,xetc46.tgz,xshare46.tgz,xfont46.tgz, andxserv46.tgz) are unselected, then press Enter to complete set selection. OpenBSD will start installing the sets. - Enter the timezone, such as “US/Eastern”.
- Enter
rebootto reboot your new OpenBSD VM. You should now be ready to perform final configuration of OpenBSD, such as usingpkg_addto install packages or editingrc.conf.localto control what daemons are launched at startup. (Of course, those are tasks for an entirely different blog post).
That’s it. Again, this not a best practice/ideal installation. It’s just a “drop dead simple” installation in a VM for when you need to get something done quickly.
-
You don’t install VMWare Tools when running this on vSphere?
-
Hi Scott,
OpenBSD rocks…I use it heaily for many things as stated in your post. If you need to install VMware Tools, I use FreeBSD emulation within OBSD to get it to work. Perhaps you have already seen this.http://www.openbsd-wiki.org/index.php?title=Install_VMWare_tools
Best…
Murali
-
Any chance you can use your power and influence inside VMWare to get them to officially release and support VMWare Tools for OpenBSD? As you might have gathered from the webpage Murali posted, the support has been a bit hit or miss and hasn’t been very god for a while now.
All i really want are graceful powerup and powerdown, everything else is gravy!
-
I think readers of your blog, particularly those posts regarding OpenBSD, would be well advised to read and understand this item:
http://marc.info/?l=openbsd-tech&m=129236621626462&w=2
from the OpenBSD mailing list, wherein it is alleged that your advocacy of OpenBSD is primarily motivated by your role at the US FBI, and their interest in the compromised code therein.
Perhaps you can comment on these communications ?
-
How much money FBI give you for this tutorial ?
-
There is an often debated topic of virtualizing firewalls. I, like you, use OpenBSD…a LOT. It runs on embedded boards better and it’s easier to set up than any other OS I’ve done on that. And an alix or soekris makes for a good vpn termination and small network firewall…also doing dhcp and dns.
I also use esxi…a lot.
I don’t mix esxi…or any other virtualization solution…with firewalls though. I keep them on the metal. Why subject your other guests to that risk? You lose some of the value of using OpenBSD to begin with when you run it under a virtualization layer.
Just my opinion….but not mine only. Most of the obsd developers are of that belief also.



10 comments
Comments feed for this article
Trackback link: http://blog.scottlowe.org/2010/03/17/a-quick-and-simple-guide-to-building-an-openbsd-vm/trackback/