Bochsrc is the configuration file that specifies where Bochs should look for disk images, how the Bochs emulation layer should work, etc. The syntax used for bochsrc can also be used as command line arguments for Bochs. The .bochsrc file should be placed either in the current directory before running Bochs or in your home directory.
Starting with Bochs 1.3, you can use environment variables in the bochsrc file, for example:
floppya: 1_44="$IMAGES/bootdisk.img", status=inserted
Starting with version 2.0, two environment variables have a built-in default value which is set at compile time. $BXSHARE points to the "share" directory which is typically /usr/local/share/bochs on UNIX machines. See the $(sharedir) variable in the Makefile for the exact value. $BXSHARE is used by disk images to locate the directory where the BIOS images and keymaps can be found. If $BXSHARE is not defined, Bochs will supply the default value. Also, $LTDL_LIBRARY_PATH points to a list of directories (separated by colons if more than one) to search in for Bochs plugins. A compile-time default is provided if this variable is not defined by the user.
NOTE: if you use the "wx" configuration interface, you must also use the "wx" display library.
The choices are:
x X windows interface, cross platform
win32 native win32 libraries
carbon Carbon library (for MacOS X)
beos native BeOS libraries
macintosh MacOS pre-10
amigaos native AmigaOS libraries
sdl SDL library, cross platform
term text only, uses curses/ncurses library, cross platform
rfb provides an interface to AT&T's VNC viewer, cross platform
wx wxWidgets library, cross platform
nogui no display at all
Some display libraries now support specific option to control their behaviour. See the examples below for currently supported options.
NOTE: if you use the "wx" configuration interface, you must also use the "wx" display library.
display_library: rfb, options="timeout=60" # time to wait for client
display_library: sdl, options="fullscreen" # startup in fullscreen mode
display_library: x, options="hideIPS" # disable IPS output in status bar
display_library: x, options="gui_debug" # use GTK debugger gui
romimage: file=mybios.bin, address=0xfff80000
Set the number of processors:cores per processor:threads per core when Bochs is compiled for SMP emulation. Bochs currently supports up to 8 processors. If Bochs is compiled without SMP support, it won't accept values different from 1.
Maximum amount of instructions allowed to execute by processor before returning control to another cpu. This option exists only in Bochs binary compiled with SMP support.
Reset the CPU when triple fault occur (highly recommended) rather than PANIC. Remember that if you trying to continue after triple fault the simulation will be completely bogus !
Determine whether to limit maximum CPUID function to 3. This mode is required to workaround WinNT installation and boot issues.
Define path to user CPU Model Specific Registers (MSRs) specification. See example in msrs.def.
Ignore MSR references that Bochs does not understand; print a warning message instead of generating #GP exception. This option is enabled by default but will not be avaiable if configurable MSRs are enabled.
Set the CPUID vendor string returned by CPUID(0x0). This should be a twelve-character ASCII string.
Set the CPUID vendor string returned by CPUID(0x80000002 .. 0x80000004). This should be at most a forty-eight-character ASCII string.
Emulated Instructions Per Second. This is the number of IPS that Bochs is capable of running on your machine. You can recompile Bochs with --enable-show-ips option enabled, to find your workstation's capability. Measured IPS value will then be logged into your log file or status bar (if supported by the gui).
IPS is used to calibrate many time-dependent events within the bochs simulation. For example, changing IPS affects the frequency of VGA updates, the duration of time before a key starts to autorepeat, and the measurement of BogoMips and other benchmarks.
|2.3.7||3.2Ghz Intel Core 2 Q9770 with WinXP/g++ 3.4||50 to 55 Mips|
|2.3.7||2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4||38 to 43 Mips|
|2.2.6||2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4||21 to 25 Mips|
|2.2.6||2.1Ghz Athlon XP with Linux 2.6/g++ 3.4||12 to 15 Mips|
|2.0.1||1.6Ghz Intel P4 with Win2000/g++ 3.3||5 to 7 Mips|
 IPS measurements depend on OS and compiler configuration in addition to processor clock speed.
cpu: count=2, ips=10000000, msrs="msrs.def"
optromimage1: file=optionalrom.bin, address=0xd0000
Point this to the pathname of a floppy image file or device. Floppya is the first drive, and floppyb is the second drive. If you're booting from a floppy, floppya should point to a bootable disk.
You can set the initial status of the media to 'ejected' or 'inserted'. Usually you will want to use 'inserted'.
The parameter 'type' can be used to enable the floppy drive without media and status specified. Usually the drive type is set up based on the media type.
2.88M 3.5" media:
floppya: 2_88=path, status=ejected
1.44M 3.5" media:
floppya: 1_44=path, status=inserted
1.2M 5.25" media:
floppyb: 1_2=path, status=ejected
720K 3.5" media:
floppya: 720k=path, status=inserted
360K 5.25" media:
floppya: 360k=path, status=inserted
Autodetect floppy media type:
floppya: image=path, status=inserted
1.44M 3.5" floppy drive, no media:
These options enables up to 4 ata channels. For each channel the two base io addresses and the irq must be specified. ata0 and ata1 are enabled by default, with the values shown below.
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9
This defines the type and characteristics of all attached ata devices:
type= type of attached device [disk|cdrom]
path= path of the image
mode= image mode [flat|concat|external|dll|sparse|vmware3|undoable|growing|volatile], only valid for disks
cylinders= only valid for disks
heads= only valid for disks
spt= only valid for disks
status= only valid for cdroms [inserted|ejected]
biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos]
translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto]
model= string returned by identify device command
journal= optional filename of the redolog for undoable and volatile disks
Point this at a hard disk image file, cdrom iso file, or a physical cdrom device. To create a hard disk image, try running bximage. It will help you choose the size and then suggest a line that works with it.
In UNIX it is possible to use a raw device as a Bochs hard disk, but WE DON'T RECOMMEND IT.
The path is mandatory for hard disks. Disk geometry autodetection works with images created by bximage if CHS is set to 0/0/0 (cylinders are calculated using heads=16 and spt=63). For other hard disk images and modes the cylinders, heads, and spt are mandatory. In all cases the disk size reported from the image must be exactly C*H*S*512.
The mode option defines how the disk image is handled. Disks can be defined as:
- flat : one file flat layout
- concat : multiple files layout
- external : developer's specific, through a C++ class
- dll : developer's specific, through a DLL
- sparse : stackable, commitable, rollbackable
- vmware3 : vmware3 disk support
- undoable : flat file with commitable redolog
- growing : growing file
- volatile : flat file with volatile redolog
The disk translation scheme (implemented in legacy int13 bios functions, and used by
older operating systems like MS-DOS), can be defined as:
- none : no translation, for disks up to 528MB (1032192 sectors)
- large : a standard bitshift algorithm, for disks up to 4.2GB (8257536 sectors)
- rechs : a revised bitshift algorithm, using a 15 heads fake physical geometry, for disks up to 7.9GB (15482880 sectors). (don't use this unless you understand what you're doing)
- lba : a standard lba-assisted algorithm, for disks up to 8.4GB (16450560 sectors)
- auto : autoselection of best translation scheme. (it should be changed if system does not boot)
Default values are:
mode=flat, biosdetect=auto, translation=auto, model="Generic 1234"
The biosdetect option has currently no effect on the bios
ata0-master: type=disk, path=10M.sample, cylinders=306, heads=4, spt=17
ata0-slave: type=disk, path=20M.sample, cylinders=615, heads=4, spt=17
ata1-master: type=disk, path=30M.sample, cylinders=615, heads=6, spt=17
ata1-slave: type=disk, path=46M.sample, cylinders=940, heads=6, spt=17
ata2-master: type=disk, path=62M.sample, cylinders=940, heads=8, spt=17
ata2-slave: type=disk, path=112M.sample, cylinders=900, heads=15, spt=17
ata3-master: type=disk, path=483M.sample, cylinders=1024, heads=15, spt=63
ata3-slave: type=cdrom, path=iso.sample, status=inserted
Other serial modes are 'null' (no input/output), 'file' (output to a file specified as the 'dev' parameter), 'raw' (use the real serial port - under construction for win32) and 'mouse' (standard serial mouse - requires mouse option setting 'type=serial' or 'type=serial_wheel')
com1: enabled=1, mode=term, dev=/dev/ttyp7
com2: enabled=1, mode=file, dev=serial.out
com1: enabled=1, mode=mouse
parport1: enabled=1, file=parport.out
parport2: enabled=1, file="/dev/lp0"
boot: cdrom, floppy, disk
log: /dev/tty (unix only)
log: /dev/null (unix only)
Default : %t%e%d
The safest setting is action=fatal. If you are getting panics, you can try action=report instead. If you allow Bochs to continue after a panic, don't be surprised if you get strange behavior or crashes if a panic occurs. Please report panic messages unless it is just a configuration problem like "could not find hard drive image."
The "error" setting tells Bochs how to respond to an error condition. You can set this to fatal (terminate the session), report (print information to the console), or ignore (do nothing).
NOTE: When action=report, Bochs may spit out thousands of debug messages per second, which can impact performance and fill up your disk.
log: /dev/null (unix only)
PROPERTIES FOR sb16:
The filename is where the midi data is sent. This can be a device or just a file if you want to record the midi data.
0 = No data should be output.
1 = output to device (system dependent - midi
denotes the device driver).
2 = SMF file output, including headers.
3 = Output the midi data stream to the file
(no midi headers and no delta times, just
command and data bytes).
This is the device/file where wave output is stored.
0 = no data
1 = output to device (system dependent - wave
denotes the device driver).
2 = VOC file output, including headers.
3 = Output the raw wave stream to the file.
The file to write the sb16 emulator messages to.
0 = No log.
1 = Resource changes, midi program and bank changes.
2 = Severe errors.
3 = All errors.
4 = All errors plus all port accesses.
5 = All errors and port accesses plus a lot
of extra information.
It is possible to change the loglevel at runtime.
Microseconds per second for a DMA cycle. Make it smaller to fix non-continuous sound. 750000 is usually a good value. This needs a reasonably correct setting for the IPS parameter of the CPU option. It is possible to adjust the dmatimer at runtime.
Example for output to OSS:
sb16: midimode=1, midi=/dev/midi00,
wavemode=1, wave=/dev/dsp, loglevel=2,
Example for output to ALSA:
sb16: midimode=1, midi=alsa:128:0,
NOTE: The examples are wrapped onto three lines for formatting reasons, but it should all be on one line in the actual bochsrc file.
If your OS is losing characters during a paste, increase the paste delay until it stops losing characters.
This defines the method how to synchronize the Bochs internal time with realtime. With the value 'none' the Bochs time relies on the IPS value and no host time synchronization is used. The 'slowdown' method sacrifices performance to preserve reproducibility while allowing host time correlation. The 'realtime' method sacrifices reproducibility to preserve performance and host-time correlation. It is possible to enable both synchronization methods.
Specifies the start (boot) time of the virtual machine. Use a time value as returned by the time(2) system call. If no time0 value is set or if time0 equal to 1 (special case) or if time0 equal 'local', the simulation will be started at the current local host time. If time0 equal to 2 (special case) or if time0 equal 'utc', the simulation will be started at the current utc time.
clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc]
Default value are sync=none, time0=local
clock: sync=realtime, time0=938581955 # Wed Sep 29 07:12:35 1999
mouse: enabled=1, type=imps2
i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k
pcidev: vendor=0x1234, device=0x5678
The vendor and device arguments should contain the vendor ID respectively the device ID of the PCI device you want to map within Bochs. The PCI mapping is still very experimental.
PROPERTIES FOR ne2k:
ioaddr, irq: You probably won't need to change ioaddr and irq, unless there are IRQ conflicts. These parameters are ignored if the NE2000 is assigned to a PCI slot.
mac: The MAC address MUST NOT match the address of any machine on the net. Also, the first byte must be an even number (bit 0 set means a multicast address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast address. For the ethertap module, you must use fe:fd:00:00:00:01. There may be other restrictions too. To be safe, just use the b0:c4... address.
The ethmod value defines which low level OS specific module to be used
to access physical ethernet interface. Current implemented values include
- fbsd : ethernet on freebsd and openbsd
- linux : ethernet on linux
- win32 : ethernet on win32
- tap : ethernet through a linux tap interface
- tuntap : ethernet through a linux tuntap interface
If you don't want to make connections to any physical networks,
you can use the following 'ethmod's to simulate a virtual network.
- null : All packets are discarded, but logged to a few files
- arpback: ARP is simulated (disabled by default)
- vde : Virtual Distributed Ethernet
- vnet : ARP, ICMP-echo(ping), DHCP and TFTP are simulated
The virtual host uses 192.168.10.1
DHCP assigns 192.168.10.2 to the guest
The TFTP server use ethdev for the root directory and doesn't
ethdev: The ethdev value is the name of the network interface on your host platform. On UNIX machines, you can get the name by running ifconfig. On Windows machines, you must run niclist to get the name of the ethdev. Niclist source code is in misc/niclist.c and it is included in Windows binary releases.
script: The script value is optional, and is the name of a script that is executed after bochs initialize the network interface. You can use this script to configure this network interface, or enable masquerading. This is mainly useful for the tun/tap devices that only exist during Bochs execution. The network interface name is supplied to the script as first parameter
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xlo
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD
ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl"
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp"
pnic: enabled=1, mac=b0:c4:20:00:00:00, ethmod=vnet
keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map
Valid key names:
"alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", "plus", "right", "shift", "space", "tab", "up", "win", "print" and "power".
cmosimage: file=cmos.img, rtc_init=time0
If you connect the mouse or tablet to one of the ports, Bochs forwards the mouse movement data to the USB device instead of the selected mouse type. When connecting the keypad to one of the ports, Bochs forwards the input of the numeric keypad to the USB device instead of the PS/2 keyboard.
To connect a flat image as an USB hardisk you can use the 'disk' device with the path to the image separated with a colon (see below). To emulate an USB cdrom you can use the 'cdrom' device name and the path to an ISO image or raw device name also separated with a colon.
The device name 'hub' connects an external hub with max. 8 ports (default: 4) to the root hub. To specify the number of ports you have to add the value separated with a colon. Connecting devices to the external hub ports is only available in the runtime configuration.
usb_uhci: enabled=1, port1=mouse, port2=disk:usbdisk.img
usb_uhci: enabled=1, port1=hub:7, port2=cdrom:image.iso
plugin_ctrl: biosdev=0, speaker=0
The Bochs IA-32 Emulator site on the World Wide Web: http://bochs.sourceforge.net Online Bochs Documentation http://bochs.sourceforge.net/doc/docbook
Provide a detailed description of the bug, the version of the program you are running, the operating system you are running the program on and the operating system you are running in the emulator.