FreeBSD in VMware
Considerations for installing FreeBSD in VMware Fusion 2.0
Installing various 6.x and 7.x releases (both i386 and amd64) works without a hitch (I usually work off the disk1 image). Various 8-current snapshots also worked fine, and most of the following is based on 8-BETA3. Although I'm working on VMware Fusion 2.0.5, most of this should apply to other (current) VMware products as well.
Kernel Config
I've pared down my kernel config to remove unnecessary devices, and to be able to load and unload certain drivers on demand, to aid in debugging etc.
# Minimal Configuration # # $FreeBSD: head/sys/amd64/conf/GENERIC 195618 2009-07-11 15:02:45Z rpaulo $ cpu HAMMER ident MINIMAL makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling options MD_ROOT # MD is a potential root device options NFSCLIENT # Network Filesystem Client options NFSSERVER # Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCLIENT options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) options COMPAT_IA32 # Compatible with i386 binaries options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options SCSI_DELAY=500 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev #options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework options FLOWTABLE # per-cpu routing cache #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks options SMP # Symmetric MultiProcessor Kernel options SC_PIXEL_MODE options SC_NORM_ATTR=(FG_BLACK|BG_LIGHTGREY) options SC_NORM_REV_ATTR=(FG_WHITE|BG_BLACK) options SC_KERNEL_CONS_ATTR=(FG_BLUE|BG_LIGHTGREY) options SC_KERNEL_CONS_REV_ATTR=(FG_WHITE|BG_BLUE) # Debugging for use in -current options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. #options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for spedevice agp # support several AGP chipsets device scbus # SCSI bus (required for SCSI) options ATA_STATIC_ID # Static device numbering # SCSI devices are not available as modules device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct SCSI access) device ses # SCSI Environmental Services (and SAF-TE) device atkbdc # AT keyboard controller device atkbd # AT keyboard device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver device sc device uart # Generic UART driver device loop # Network loopback device ether # Ethernet support device bpf # Berkeley packet filter
loader.conf
# quick boot autoboot_delay="1" beastie_disable="YES" # drivers for "on-board" VMware hardware, plus other essentials snd_es137x_load="YES" mpt_load="YES" ata_load="YES" atapci_load="YES" atadisk_load="YES" atapicd_load="YES" if_em_load="YES" random_load="YES" uhci_load="YES" ehci_load="YES" # optional drivers for USB devices umass_load="YES" uplcom_load="YES" uftdi_load="YES" # VESA is currently only available on i386 #vesa_load="YES"
rc.conf
# standard console configuration: ISO-8859-1 charset and German keyboard layout font8x14="iso-8x14" font8x16="iso-8x16" font8x8="iso-8x8" keymap="german.iso" dbus_enable="YES" hald_enable="YES"
Packages
Minimum X11
The following list adds the minimum X11 support. You will want fonts, a window manager, etc. See below.
- x11-drivers/xf86-input-keyboard
- x11-drivers/xf86-input-mouse
- x11-drivers/xf86-video-vmware
- x11-fonts/xorg-fonts
To set a non-standard keyboard layout, add a file /usr/local/etc/hal/fdi/policy/x11-xkb.fdi
:
<?xml version="1.0" encoding="ISO-8859-1"?> <deviceinfo version="0.2"> <device> <match key="info.capabilities" contains="input.keyboard"> <merge key="input.xkb.layout" type="string">de</merge> </match> </device> </deviceinfo>
Simple X11 Setup
Here's a small footprint X11 setup to get going:
- x11-wm/windowmaker
- x11/xterm
xorg.conf
The auto-generated xorg.conf (X -configure) is almost complete, but I did make a few changes:
Use the VMware mouse driver:
Section "InputDevice" Identifier "Mouse0" Driver "vmmouse" Option "Device" "/dev/sysmouse" Option "ZAxisMapping" "4 5 6 7" EndSection
Fix monitor timings to allow all resolutions (no idea why the autodetection is not working properly):
Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "Monitor Model" HorizSync 30-100 VertRefresh 56-120 EndSection
Useful links
- VESA driver for amd64 Note that the mentioned PR for enabling 8bit modes in syscons has been committed since.
- A Power User's Guide to VMware Fusion