Datenschutz
Home/IT/OpenBSD/OpenBSD  

Das virtuelle (OS-) Museum  

 

Auf diesen Seiten geht es um die Installation und Konfiguration der schon etwas veralteten Version 4.9 von OpenBSD in einem virtuellen Computer (VMware oder Virtual Box). Dies ist keine Einführung in OpenBSD. Dafür empfehle ich die offizielle OpenBSD-Website mit ihrer ausführlichen Installationsanleitung. Diese bezieht sich zwar auf die jeweils neueste Version, aber dramatisch sind die Änderungen zwischen den Releases normalerweise nicht.

OpenBSD 4.9 in VMware Workstation unter Linux

Warum eine ältere Version? Aus historisch-nostalgischen Gründen. In meinem OS-Museum laufen drei OpenBSD-VMs: Mit Version 2.6 habe ich dieses BSD einst kennengelernt. Die hier besprochene Version 4.9 gehört mit ihren Packages schon zu den benutzbaren Workstations. Und dann natürlich die jeweils aktuelle Ausgabe, das ist zum Zeitpunkt, da ich diesen Artikel schreibe, die 7.2.

Vorbereitung

Boot CD-Rom

To get OpenBSD installed you need a boot medium and some kind of installation source. There are different ways to do that and the specific installation procedure may differ. With a fast connection to the Internet you can boot the virtual machine with a Boot CD-Rom and load the operating system components directly from an OpenBSD mirror. However, you should also buy an official CD-ROM set. This is the recommended way to get OpenBSD. Buying an OpenBSD CD set is the easiest way to support the project and the only way to get the included nice artwork.

Virtual Machine

If you are familiar with VMware (and I suppose you are) it will be no problem for you to build an OpenBSD ready virtual machine. I recommend a machine of type FreeBSD with 256 MBytes RAM. Insert two IDE hard disks with 32 GB capacity each, both connected to the same controller. The other IDE channel should hold the CD-ROM drive, at your option as a physical drive or as an ISO image. A Floppy drive is not needed.

For the impatient: You may use my VM template:

Planned disk layout

I will spread my data over two hard disks: one ist the permanent system disks which holds all permanent OS and user data. The other one is mounted on /data and is filled with temporary data which are normally expected under /usr/ports or /usr/src. This way it's much easier to shrink this disks by just replacing it with a new one.

This is the planned layout on both disks:

Partition Mount Point Size in MB
wd0a / 512
wd0b swap 1024
wd0d /var 1024
wd0e /tmp 1024
wd0f /usr 4096
wd0g /usr/local 4096
wd0h /home Rest
Partition Mount Point Size in MB
wd1a /data All

Installation

CD-ROM: 9F
Loading /4.9/I386/CDBOOT
probing: pc0 com0 com1 apm pci mem[634K 253M 1024K a20=on]
disk fd0 hd0+* hd1+* cd0
>> OpenBSD/i386 CDBOOT 3.15
boot> [ENTER]
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell?  i
kbd(8) mapping? ('L' for list) [none] de
kbd: keyboard mapping set to de
System hostname? (short form, e.g. 'foo') roosta
Available network interfaces are: em0 vlan0.
Which one do you wish to configure? (or 'done') [em0] 
IPv4 address for em0? (or 'none' or 'dhcp') [dhcp] 192.168.4.221
Netmask? [255.255.255.0] 
IPv6 address for em0? (or 'rtsol' or 'none') [none] 
Available network interfaces are: em0 vlan0.
Which one do you wish to configure? (or 'done') [done] 
Default IPv4 route? (IPv4 address, 'dhcp' or 'none') 192.168.4.2
add net default: gateway 192.168.4.2
DNS domain name? (e.g. 'bar.com') [my.domain] localdomain
DNS nameservers? (IP address list or 'none') [none] 192.168.4.2
Do you want to do any manual network configuration? [no] 
Password for root account? (will not echo) ++++++++
Password for root account? (again) ++++++++
Start sshd(8) by default? [yes] 
Start ntpd(8) by default? [no] 
Do you expect to run the X Window System? [yes] 
Do you want the X Window System to be started by xdm(1)? [no] 
Change the default console to com0? [no] 
Setup a user? (enter a lower-case loginname, or 'no') [no] 
Available disks are: wd0 wd1.
Which one is the root disk? (or 'done') [done] wd0
MBR has invalid signature; not showing it.
Use (W)hole disk or (E)dit the MBR? [whole] 
Setting OpenBSD MBR partition to whole wd0...done.
The auto-allocated layout for wd0 is:
#                size           offset  fstype [fsize bsize  cpg]
  a:          1024.0M               64  4.2BSD   2048 16384    1 # /
  b:           511.1M          2097216    swap                   
  c:         32768.0M                0  unused                   
  d:          2189.9M          3143872  4.2BSD   2048 16384    1 # /tmp
  e:          3443.5M          7628704  4.2BSD   2048 16384    1 # /var
  f:          2048.0M         14681056  4.2BSD   2048 16384    1 # /usr
  g:          1024.0M         18875360  4.2BSD   2048 16384    1 # /usr/X11R6
  h:          4635.3M         20972512  4.2BSD   2048 16384    1 # /usr/local
  i:          1800.2M         30465664  4.2BSD   2048 16384    1 # /usr/src
  j:          1800.2M         34152448  4.2BSD   2048 16384    1 # /usr/obj
  k:         14289.2M         37839232  4.2BSD   2048 16384    1 # /home
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] c
Initial label editor (enter '?' for help at any prompt)
> p
OpenBSD area: 64-67103505; size: 67103441; free: 67103441
#                size           offset  fstype [fsize bsize  cpg]
  c:         67108864                0  unused         
> a
partition: [a] 
offset: [64] 
size: [67103441] 512m
Rounding to cylinder: 1060226
FS type: [4.2BSD]
mount point: [none] /
> a
partition: [b] 
offset: [1060288] 
size: [66043217] 1024m
Rounding to cylinder: 2088452
FS type: [swap] 
> a
partition: [d] 
offset: [3148740] 
size: [63954765] 1024m
Rounding to cylinder: 2104515
FS type: [4.2BSD] 
mount point: [none] /var
> a
partition: [e] 
offset: [5253248] 
size: [61850257] 1024m
Rounding to cylinder: 2088457
FS type: [4.2BSD] 
mount point: [none] /tmp
> a
partition: [f] 
offset: [7341696] 
size: [59761809] 4096m
Rounding to cylinder: 8385939
FS type: [4.2BSD] 
mount point: [none] /usr
> a
partition: [g] 
offset: [15727616] 
size: [51375889] 4096m
Rounding to cylinder: 8385949
FS type: [4.2BSD] 
mount point: [none] /usr/local
> a
partition: [h] 
offset: [24113536] 
size: [42989969] 
FS type: [4.2BSD] 
mount point: [none] /home
> p
OpenBSD area: 64-67103505; size: 67103441; free: 0
#                size           offset  fstype [fsize bsize  cpg]
  a:          1060224               64  4.2BSD   2048 16384    1 # /
  b:          2088452          1060288    swap                   
  c:         67108864                0  unused                   
  d:          2104480          3148768  4.2BSD   2048 16384    1 # /var
  e:          2088448          5253248  4.2BSD   2048 16384    1 # /tmp
  f:          8385920          7341696  4.2BSD   2048 16384    1 # /usr
  g:          8385920         15727616  4.2BSD   2048 16384    1 # /usr/local
  h:         42989952         24113536  4.2BSD   2048 16384    1 # /home
> w
> q
No label changes.
Available disks are: wd1.
Which one do you wish to initialize? (or 'done') [done] wd1
MBR has invalid signature; not showing it.
Use (W)hole disk or (E)dit the MBR? [whole] 
Initial label editor (enter '?' for help at any prompt)
> p
OpenBSD area: 64-67103505; size: 67103442; free: 67103441
#                size           offset  fstype [fsize bsize  cpg]
  c:         67108864                0  unused                   
> a
partition: [a] 
offset: [64] 
size: [67103441] 
FS type: [4.2BSD] 
mount point: [none] /data
> p
OpenBSD area: 64-67103505; size: 67103442; free: 0
#                size           offset  fstype [fsize bsize  cpg]
  a:         67103441               64  4.2BSD   2048 16384    1 # /data
  c:         67108864                0  unused                   
> w
> q
No label changes.
No more disks to initialize.
Let's install the sets!
Location of sets? (cd disk ftp http or 'done') [cd] h
HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none]
Server? (IP address, hostname, list#, 'done' or '?') openbsd.cs.fau.de
Server directory? [pub/OpenBSD/4.9/i386]
Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.
    [X] bsd           [X] etc49.tgz     [X] xbase49.tgz   [X] xserv49.tgz
    [X] bsd.rd        [X] comp49.tgz    [X] xetc49.tgz
    [ ] bsd.mp        [X] man49.tgz     [X] xshare49.tgz
    [X] base49.tgz    [X] game49.tgz    [X] xfont49.tgz
Set name(s)? (or 'abort' or 'done') [done] all
    [X] bsd           [X] etc49.tgz     [X] xbase49.tgz   [X] xserv49.tgz
    [X] bsd.rd        [X] comp49.tgz    [X] xetc49.tgz
    [X] bsd.mp        [X] man49.tgz     [X] xshare49.tgz
    [X] base49.tgz    [X] game49.tgz    [X] xfont49.tgz
Set name(s)? (or 'abort' or 'done') [done] 
bsd          100% |*************************************|  8809 KB    00:03    
bsd.rd       100% |*************************************|  6227 KB    00:02    
bsd.mp       100% |*************************************|  8833 KB    00:03    
base49.tgz   100% |*************************************| 53505 KB    00:36    
etc49.tgz    100% |*************************************|   507 KB    00:00    
comp49.tgz   100% |*************************************| 56767 KB    00:44    
man49.tgz    100% |*************************************|  9121 KB    00:06    
game49.tgz   100% |*************************************|  2568 KB    00:01    
xbase49.tgz  100% |*************************************| 11581 KB    00:06    
xetc49.tgz   100% |*************************************| 71655       00:00    
xshare49.tgz 100% |*************************************|  2969 KB    00:01    
xfont49.tgz  100% |*************************************| 38484 KB    00:20    
xserv49.tgz  100% |*************************************| 20720 KB    00:14    
Location of sets? (cd disk ftp http or 'done') [done] 
What timezone are you in? ('?' for list) [Canada/Mountain] Europe/Berlin
Saving configuration files...done.
Generating initial host.random file...done.
Making all device nodes...done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter 'reboot' at the command prompt.
When you login to your new system the first time, please read your mail
using the 'mail' command.

# reboot
syncing disks... done
rebooting...

Configuration

The installation of OpenBSD 4.9 itself has been finished but there still are a couple of things to do.

Freshly installed: OpenBSD 4.9.

Login

jexss@linux:~$ ssh root@roosta

CD-Rom Drive

# mkdir /cdrom
# echo "/dev/cd0c /cdrom cd9660 ro,noauto 0 0" >> /etc/fstab

Regular User

# adduser
...
Enter username []: jexss
Enter full name []: Jan Exss
Enter shell csh ksh nologin sh [sh]: 
Uid [1000]: 1042
Login group jexss [jexss]: 
Login group is ``jexss''. Invite jexss into other groups: guest no 
[no]: wheel
Login class authpf daemon default staff [default]: 
Enter password []: ++++++++
Enter password again []: ++++++++
...
Add another user? (y/n) [y]: n

File Systems

# perl -pi -e 's/ffs rw/ffs rw,softdep/' /etc/fstab                                                                                                    

Services

# echo 'httpd_flags=""' >> /etc/rc.conf.local
# echo 'xdm_flags=""'   >> /etc/rc.conf.local

X11

# Xorg -configure
# perl -pi -e 's/24$/24\n\t\tModes\t"1024x768"/' xorg.conf.new
# perl -pi -e 's/"Monitor Model"$/"Monitor Model"\n\tHorizSync\t30-65\n\tVertRefresh\t50-75\n\tDisplaySize\t345 260/' xorg.conf.new
# mv /root/xorg.conf.new /etc/X11/xorg.conf
# wsconsctl keyboard.encoding=de
# echo "wsconsctl keyboard.encoding=de" >> /etc/wsconsctl.conf

Finish

# reboot

OpenBSD 4.9: XDM login screen and the default Fvwm window manager.