# Modification to the patch provided by the GNS3 team here: # http://sourceforge.net/projects/gns-3/files/Qemu/qemu-0.13.0.patched.win32.zip/download # # This patch comes with no warranty, use at your own discretion. # No code in this patch was written by myself, it's all the work of others. # I only made alterations to allow it to patch correctly on my system # # Matthew Gillespie, braindeadprojects.com 06/19/2011 diff -Naur qemu-kvm-0.13.0/Makefile.objs qemu-0.13.0-patched/Makefile.objs --- qemu-kvm-0.13.0/Makefile.objs 2010-10-14 11:06:47.000000000 -0400 +++ qemu-0.13.0-patched/Makefile.objs 2011-06-19 16:46:26.000000000 -0400 @@ -26,6 +26,7 @@ net-nested-y = queue.o checksum.o util.o net-nested-y += socket.o net-nested-y += dump.o +net-nested-y += udp.o net-nested-$(CONFIG_POSIX) += tap.o net-nested-$(CONFIG_LINUX) += tap-linux.o net-nested-$(CONFIG_WIN32) += tap-win32.o diff -Naur qemu-kvm-0.13.0/QMP/qmp-commands.txt qemu-0.13.0-patched/QMP/qmp-commands.txt --- qemu-kvm-0.13.0/QMP/qmp-commands.txt 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/QMP/qmp-commands.txt 2011-06-19 16:52:33.000000000 -0400 @@ -0,0 +1,1181 @@ + QMP Supported Commands + ---------------------- + +This document describes all commands currently supported by QMP. + +Most of the time their usage is exactly the same as in the user Monitor, this +means that any other document which also describe commands (the manpage, +QEMU's manual, etc) can and should be consulted. + +QMP has two types of commands: regular and query commands. Regular commands +usually change the Virtual Machine's state someway, while query commands just +return information. The sections below are divided accordingly. + +It's important to observe that all communication examples are formatted in +a reader-friendly way, so that they're easier to understand. However, in real +protocol usage, they're emitted as a single line. + +Also, the following notation is used to denote data flow: + +-> data issued by the Client +<- Server data response + +Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed +information on the Server command and response formats. + +NOTE: This document is temporary and will be replaced soon. + +1. Stability Considerations +=========================== + +The current QMP command set (described in this file) may be useful for a +number of use cases, however it's limited and several commands have bad +defined semantics, specially with regard to command completion. + +These problems are going to be solved incrementally in the next QEMU releases +and we're going to establish a deprecation policy for badly defined commands. + +If you're planning to adopt QMP, please observe the following: + + 1. The deprecation policy will take efect and be documented soon, please + check the documentation of each used command as soon as a new release of + QEMU is available + + 2. DO NOT rely on anything which is not explicit documented + + 3. Errors, in special, are not documented. Applications should NOT check + for specific errors classes or data (it's strongly recommended to only + check for the "error" key) + +2. Regular Commands +=================== + +Server's responses in the examples below are always a success response, please +refer to the QMP specification for more details on error responses. + +quit +---- + +Quit the emulator. + +Arguments: None. + +Example: + +-> { "execute": "quit" } +<- { "return": {} } + +eject +----- + +Eject a removable medium. + +Arguments: + +- force: force ejection (json-bool, optional) +- device: device name (json-string) + +Example: + +-> { "execute": "eject", "arguments": { "device": "ide1-cd0" } } +<- { "return": {} } + +Note: The "force" argument defaults to false. + +change +------ + +Change a removable medium or VNC configuration. + +Arguments: + +- "device": device name (json-string) +- "target": filename or item (json-string) +- "arg": additional argument (json-string, optional) + +Examples: + +1. Change a removable medium + +-> { "execute": "change", + "arguments": { "device": "ide1-cd0", + "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } } +<- { "return": {} } + +2. Change VNC password + +-> { "execute": "change", + "arguments": { "device": "vnc", "target": "password", + "arg": "foobar1" } } +<- { "return": {} } + +screendump +---------- + +Save screen into PPM image. + +Arguments: + +- "filename": file path (json-string) + +Example: + +-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } } +<- { "return": {} } + +stop +---- + +Stop the emulator. + +Arguments: None. + +Example: + +-> { "execute": "stop" } +<- { "return": {} } + +cont +---- + +Resume emulation. + +Arguments: None. + +Example: + +-> { "execute": "cont" } +<- { "return": {} } + +system_reset +------------ + +Reset the system. + +Arguments: None. + +Example: + +-> { "execute": "system_reset" } +<- { "return": {} } + +system_powerdown +---------------- + +Send system power down event. + +Arguments: None. + +Example: + +-> { "execute": "system_powerdown" } +<- { "return": {} } + +device_add +---------- + +Add a device. + +Arguments: + +- "driver": the name of the new device's driver (json-string) +- "bus": the device's parent bus (device tree path, json-string, optional) +- "id": the device's ID, must be unique (json-string) +- device properties + +Example: + +-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } } +<- { "return": {} } + +Notes: + +(1) For detailed information about this command, please refer to the + 'docs/qdev-device-use.txt' file. + +(2) It's possible to list device properties by running QEMU with the + "-device DEVICE,\?" command-line argument, where DEVICE is the device's name + +device_del +---------- + +Remove a device. + +Arguments: + +- "id": the device's ID (json-string) + +Example: + +-> { "execute": "device_del", "arguments": { "id": "net1" } } +<- { "return": {} } + +cpu +--- + +Set the default CPU. + +Arguments: + +- "index": the CPU's index (json-int) + +Example: + +-> { "execute": "cpu", "arguments": { "index": 0 } } +<- { "return": {} } + +Note: CPUs' indexes are obtained with the 'query-cpus' command. + +memsave +------- + +Save to disk virtual memory dump starting at 'val' of size 'size'. + +Arguments: + +- "val": the starting address (json-int) +- "size": the memory size, in bytes (json-int) +- "filename": file path (json-string) + +Example: + +-> { "execute": "memsave", + "arguments": { "val": 10, + "size": 100, + "filename": "/tmp/virtual-mem-dump" } } +<- { "return": {} } + +Note: Depends on the current CPU. + +pmemsave +-------- + +Save to disk physical memory dump starting at 'val' of size 'size'. + +Arguments: + +- "val": the starting address (json-int) +- "size": the memory size, in bytes (json-int) +- "filename": file path (json-string) + +Example: + +-> { "execute": "pmemsave", + "arguments": { "val": 10, + "size": 100, + "filename": "/tmp/physical-mem-dump" } } +<- { "return": {} } + +migrate +------- + +Migrate to URI. + +Arguments: + +- "blk": block migration, full disk copy (json-bool, optional) +- "inc": incremental disk copy (json-bool, optional) +- "uri": Destination URI (json-string) + +Example: + +-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } +<- { "return": {} } + +Notes: + +(1) The 'query-migrate' command should be used to check migration's progress + and final result (this information is provided by the 'status' member) +(2) All boolean arguments default to false +(3) The user Monitor's "detach" argument is invalid in QMP and should not + be used + +migrate_cancel +-------------- + +Cancel the current migration. + +Arguments: None. + +Example: + +-> { "execute": "migrate_cancel" } +<- { "return": {} } + +migrate_set_speed +----------------- + +Set maximum speed for migrations. + +Arguments: + +- "value": maximum speed, in bytes per second (json-number) + +Example: + +-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } } +<- { "return": {} } + +migrate_set_downtime +-------------------- + +Set maximum tolerated downtime (in seconds) for migrations. + +Arguments: + +- "value": maximum downtime (json-number) + +Example: + +-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } } +<- { "return": {} } + +netdev_add +---------- + +Add host network device. + +Arguments: + +- "type": the device type, "tap", "user", ... (json-string) +- "id": the device's ID, must be unique (json-string) +- device options + +Example: + +-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } } +<- { "return": {} } + +Note: The supported device options are the same ones supported by the '-net' + command-line argument, which are listed in the '-help' output or QEMU's + manual + +netdev_del +---------- + +Remove host network device. + +Arguments: + +- "id": the device's ID, must be unique (json-string) + +Example: + +-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } +<- { "return": {} } + +balloon +------- + +Request VM to change its memory allocation (in bytes). + +Arguments: + +- "value": New memory allocation (json-int) + +Example: + +-> { "execute": "balloon", "arguments": { "value": 536870912 } } +<- { "return": {} } + +set_link +-------- + +Change the link status of a network adapter. + +Arguments: + +- "name": network device name (json-string) +- "up": status is up (json-bool) + +Example: + +-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } } +<- { "return": {} } + +getfd +----- + +Receive a file descriptor via SCM rights and assign it a name. + +Arguments: + +- "fdname": file descriptor name (json-string) + +Example: + +-> { "execute": "getfd", "arguments": { "fdname": "fd1" } } +<- { "return": {} } + +closefd +------- + +Close a file descriptor previously passed via SCM rights. + +Arguments: + +- "fdname": file descriptor name (json-string) + +Example: + +-> { "execute": "closefd", "arguments": { "fdname": "fd1" } } +<- { "return": {} } + +block_passwd +------------ + +Set the password of encrypted block devices. + +Arguments: + +- "device": device name (json-string) +- "password": password (json-string) + +Example: + +-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0", + "password": "12345" } } +<- { "return": {} } + +qmp_capabilities +---------------- + +Enable QMP capabilities. + +Arguments: None. + +Example: + +-> { "execute": "qmp_capabilities" } +<- { "return": {} } + +Note: This command must be issued before issuing any other command. + + +3. Query Commands +================= + +query-version +------------- + +Show QEMU version. + +Return a json-object with the following information: + +- "qemu": A json-object containing three integer values: + - "major": QEMU's major version (json-int) + - "minor": QEMU's minor version (json-int) + - "micro": QEMU's micro version (json-int) +- "package": package's version (json-string) + +Example: + +-> { "execute": "query-version" } +<- { + "return":{ + "qemu":{ + "major":0, + "minor":11, + "micro":5 + }, + "package":"" + } + } + +query-commands +-------------- + +List QMP available commands. + +Each command is represented by a json-object, the returned value is a json-array +of all commands. + +Each json-object contain: + +- "name": command's name (json-string) + +Example: + +-> { "execute": "query-commands" } +<- { + "return":[ + { + "name":"query-balloon" + }, + { + "name":"system_powerdown" + } + ] + } + +Note: This example has been shortened as the real response is too long. + +query-chardev +------------- + +Each device is represented by a json-object. The returned value is a json-array +of all devices. + +Each json-object contain the following: + +- "label": device's label (json-string) +- "filename": device's file (json-string) + +Example: + +-> { "execute": "query-chardev" } +<- { + "return":[ + { + "label":"monitor", + "filename":"stdio" + }, + { + "label":"serial0", + "filename":"vc" + } + ] + } + +query-block +----------- + +Show the block devices. + +Each block device information is stored in a json-object and the returned value +is a json-array of all devices. + +Each json-object contain the following: + +- "device": device name (json-string) +- "type": device type (json-string) + - Possible values: "hd", "cdrom", "floppy", "unknown" +- "removable": true if the device is removable, false otherwise (json-bool) +- "locked": true if the device is locked, false otherwise (json-bool) +- "inserted": only present if the device is inserted, it is a json-object + containing the following: + - "file": device file name (json-string) + - "ro": true if read-only, false otherwise (json-bool) + - "drv": driver format name (json-string) + - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg", + "file", "file", "ftp", "ftps", "host_cdrom", + "host_device", "host_floppy", "http", "https", + "nbd", "parallels", "qcow", "qcow2", "raw", + "tftp", "vdi", "vmdk", "vpc", "vvfat" + - "backing_file": backing file name (json-string, optional) + - "encrypted": true if encrypted, false otherwise (json-bool) + +Example: + +-> { "execute": "query-block" } +<- { + "return":[ + { + "device":"ide0-hd0", + "locked":false, + "removable":false, + "inserted":{ + "ro":false, + "drv":"qcow2", + "encrypted":false, + "file":"disks/test.img" + }, + "type":"hd" + }, + { + "device":"ide1-cd0", + "locked":false, + "removable":true, + "type":"cdrom" + }, + { + "device":"floppy0", + "locked":false, + "removable":true, + "type": "floppy" + }, + { + "device":"sd0", + "locked":false, + "removable":true, + "type":"floppy" + } + ] + } + +query-blockstats +---------------- + +Show block device statistics. + +Each device statistic information is stored in a json-object and the returned +value is a json-array of all devices. + +Each json-object contain the following: + +- "device": device name (json-string) +- "stats": A json-object with the statistics information, it contains: + - "rd_bytes": bytes read (json-int) + - "wr_bytes": bytes written (json-int) + - "rd_operations": read operations (json-int) + - "wr_operations": write operations (json-int) + - "wr_highest_offset": Highest offset of a sector written since the + BlockDriverState has been opened (json-int) +- "parent": Contains recursively the statistics of the underlying + protocol (e.g. the host file for a qcow2 image). If there is + no underlying protocol, this field is omitted + (json-object, optional) + +Example: + +-> { "execute": "query-blockstats" } +<- { + "return":[ + { + "device":"ide0-hd0", + "parent":{ + "stats":{ + "wr_highest_offset":3686448128, + "wr_bytes":9786368, + "wr_operations":751, + "rd_bytes":122567168, + "rd_operations":36772 + } + }, + "stats":{ + "wr_highest_offset":2821110784, + "wr_bytes":9786368, + "wr_operations":692, + "rd_bytes":122739200, + "rd_operations":36604 + } + }, + { + "device":"ide1-cd0", + "stats":{ + "wr_highest_offset":0, + "wr_bytes":0, + "wr_operations":0, + "rd_bytes":0, + "rd_operations":0 + } + }, + { + "device":"floppy0", + "stats":{ + "wr_highest_offset":0, + "wr_bytes":0, + "wr_operations":0, + "rd_bytes":0, + "rd_operations":0 + } + }, + { + "device":"sd0", + "stats":{ + "wr_highest_offset":0, + "wr_bytes":0, + "wr_operations":0, + "rd_bytes":0, + "rd_operations":0 + } + } + ] + } + +query-cpus +---------- + +Show CPU information. + +Return a json-array. Each CPU is represented by a json-object, which contains: + +- "CPU": CPU index (json-int) +- "current": true if this is the current CPU, false otherwise (json-bool) +- "halted": true if the cpu is halted, false otherwise (json-bool) +- Current program counter. The key's name depends on the architecture: + "pc": i386/x86_64 (json-int) + "nip": PPC (json-int) + "pc" and "npc": sparc (json-int) + "PC": mips (json-int) + +Example: + +-> { "execute": "query-cpus" } +<- { + "return":[ + { + "CPU":0, + "current":true, + "halted":false, + "pc":3227107138 + }, + { + "CPU":1, + "current":false, + "halted":true, + "pc":7108165 + } + ] + } + +query-pci +--------- + +PCI buses and devices information. + +The returned value is a json-array of all buses. Each bus is represented by +a json-object, which has a key with a json-array of all PCI devices attached +to it. Each device is represented by a json-object. + +The bus json-object contains the following: + +- "bus": bus number (json-int) +- "devices": a json-array of json-objects, each json-object represents a + PCI device + +The PCI device json-object contains the following: + +- "bus": identical to the parent's bus number (json-int) +- "slot": slot number (json-int) +- "function": function number (json-int) +- "class_info": a json-object containing: + - "desc": device class description (json-string, optional) + - "class": device class number (json-int) +- "id": a json-object containing: + - "device": device ID (json-int) + - "vendor": vendor ID (json-int) +- "irq": device's IRQ if assigned (json-int, optional) +- "qdev_id": qdev id string (json-string) +- "pci_bridge": It's a json-object, only present if this device is a + PCI bridge, contains: + - "bus": bus number (json-int) + - "secondary": secondary bus number (json-int) + - "subordinate": subordinate bus number (json-int) + - "io_range": I/O memory range information, a json-object with the + following members: + - "base": base address, in bytes (json-int) + - "limit": limit address, in bytes (json-int) + - "memory_range": memory range information, a json-object with the + following members: + - "base": base address, in bytes (json-int) + - "limit": limit address, in bytes (json-int) + - "prefetchable_range": Prefetchable memory range information, a + json-object with the following members: + - "base": base address, in bytes (json-int) + - "limit": limit address, in bytes (json-int) + - "devices": a json-array of PCI devices if there's any attached, each + each element is represented by a json-object, which contains + the same members of the 'PCI device json-object' described + above (optional) +- "regions": a json-array of json-objects, each json-object represents a + memory region of this device + +The memory range json-object contains the following: + +- "base": base memory address (json-int) +- "limit": limit value (json-int) + +The region json-object can be an I/O region or a memory region, an I/O region +json-object contains the following: + +- "type": "io" (json-string, fixed) +- "bar": BAR number (json-int) +- "address": memory address (json-int) +- "size": memory size (json-int) + +A memory region json-object contains the following: + +- "type": "memory" (json-string, fixed) +- "bar": BAR number (json-int) +- "address": memory address (json-int) +- "size": memory size (json-int) +- "mem_type_64": true or false (json-bool) +- "prefetch": true or false (json-bool) + +Example: + +-> { "execute": "query-pci" } +<- { + "return":[ + { + "bus":0, + "devices":[ + { + "bus":0, + "qdev_id":"", + "slot":0, + "class_info":{ + "class":1536, + "desc":"Host bridge" + }, + "id":{ + "device":32902, + "vendor":4663 + }, + "function":0, + "regions":[ + + ] + }, + { + "bus":0, + "qdev_id":"", + "slot":1, + "class_info":{ + "class":1537, + "desc":"ISA bridge" + }, + "id":{ + "device":32902, + "vendor":28672 + }, + "function":0, + "regions":[ + + ] + }, + { + "bus":0, + "qdev_id":"", + "slot":1, + "class_info":{ + "class":257, + "desc":"IDE controller" + }, + "id":{ + "device":32902, + "vendor":28688 + }, + "function":1, + "regions":[ + { + "bar":4, + "size":16, + "address":49152, + "type":"io" + } + ] + }, + { + "bus":0, + "qdev_id":"", + "slot":2, + "class_info":{ + "class":768, + "desc":"VGA controller" + }, + "id":{ + "device":4115, + "vendor":184 + }, + "function":0, + "regions":[ + { + "prefetch":true, + "mem_type_64":false, + "bar":0, + "size":33554432, + "address":4026531840, + "type":"memory" + }, + { + "prefetch":false, + "mem_type_64":false, + "bar":1, + "size":4096, + "address":4060086272, + "type":"memory" + }, + { + "prefetch":false, + "mem_type_64":false, + "bar":6, + "size":65536, + "address":-1, + "type":"memory" + } + ] + }, + { + "bus":0, + "qdev_id":"", + "irq":11, + "slot":4, + "class_info":{ + "class":1280, + "desc":"RAM controller" + }, + "id":{ + "device":6900, + "vendor":4098 + }, + "function":0, + "regions":[ + { + "bar":0, + "size":32, + "address":49280, + "type":"io" + } + ] + } + ] + } + ] + } + +Note: This example has been shortened as the real response is too long. + +query-kvm +--------- + +Show KVM information. + +Return a json-object with the following information: + +- "enabled": true if KVM support is enabled, false otherwise (json-bool) +- "present": true if QEMU has KVM support, false otherwise (json-bool) + +Example: + +-> { "execute": "query-kvm" } +<- { "return": { "enabled": true, "present": true } } + +query-status +------------ + +Return a json-object with the following information: + +- "running": true if the VM is running, or false if it is paused (json-bool) +- "singlestep": true if the VM is in single step mode, + false otherwise (json-bool) + +Example: + +-> { "execute": "query-status" } +<- { "return": { "running": true, "singlestep": false } } + +query-mice +---------- + +Show VM mice information. + +Each mouse is represented by a json-object, the returned value is a json-array +of all mice. + +The mouse json-object contains the following: + +- "name": mouse's name (json-string) +- "index": mouse's index (json-int) +- "current": true if this mouse is receiving events, false otherwise (json-bool) +- "absolute": true if the mouse generates absolute input events (json-bool) + +Example: + +-> { "execute": "query-mice" } +<- { + "return":[ + { + "name":"QEMU Microsoft Mouse", + "index":0, + "current":false, + "absolute":false + }, + { + "name":"QEMU PS/2 Mouse", + "index":1, + "current":true, + "absolute":true + } + ] + } + +query-vnc +--------- + +Show VNC server information. + +Return a json-object with server information. Connected clients are returned +as a json-array of json-objects. + +The main json-object contains the following: + +- "enabled": true or false (json-bool) +- "host": server's IP address (json-string) +- "family": address family (json-string) + - Possible values: "ipv4", "ipv6", "unix", "unknown" +- "service": server's port number (json-string) +- "auth": authentication method (json-string) + - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight", + "tls", "ultra", "unknown", "vencrypt", "vencrypt", + "vencrypt+plain", "vencrypt+tls+none", + "vencrypt+tls+plain", "vencrypt+tls+sasl", + "vencrypt+tls+vnc", "vencrypt+x509+none", + "vencrypt+x509+plain", "vencrypt+x509+sasl", + "vencrypt+x509+vnc", "vnc" +- "clients": a json-array of all connected clients + +Clients are described by a json-object, each one contain the following: + +- "host": client's IP address (json-string) +- "family": address family (json-string) + - Possible values: "ipv4", "ipv6", "unix", "unknown" +- "service": client's port number (json-string) +- "x509_dname": TLS dname (json-string, optional) +- "sasl_username": SASL username (json-string, optional) + +Example: + +-> { "execute": "query-vnc" } +<- { + "return":{ + "enabled":true, + "host":"0.0.0.0", + "service":"50402", + "auth":"vnc", + "family":"ipv4", + "clients":[ + { + "host":"127.0.0.1", + "service":"50401", + "family":"ipv4" + } + ] + } + } + +query-name +---------- + +Show VM name. + +Return a json-object with the following information: + +- "name": VM's name (json-string, optional) + +Example: + +-> { "execute": "query-name" } +<- { "return": { "name": "qemu-name" } } + +query-uuid +---------- + +Show VM UUID. + +Return a json-object with the following information: + +- "UUID": Universally Unique Identifier (json-string) + +Example: + +-> { "execute": "query-uuid" } +<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } + +query-migrate +------------- + +Migration status. + +Return a json-object. If migration is active there will be another json-object +with RAM migration status and if block migration is active another one with +block migration status. + +The main json-object contains the following: + +- "status": migration status (json-string) + - Possible values: "active", "completed", "failed", "cancelled" +- "ram": only present if "status" is "active", it is a json-object with the + following RAM information (in bytes): + - "transferred": amount transferred (json-int) + - "remaining": amount remaining (json-int) + - "total": total (json-int) +- "disk": only present if "status" is "active" and it is a block migration, + it is a json-object with the following disk information (in bytes): + - "transferred": amount transferred (json-int) + - "remaining": amount remaining (json-int) + - "total": total (json-int) + +Examples: + +1. Before the first migration + +-> { "execute": "query-migrate" } +<- { "return": {} } + +2. Migration is done and has succeeded + +-> { "execute": "query-migrate" } +<- { "return": { "status": "completed" } } + +3. Migration is done and has failed + +-> { "execute": "query-migrate" } +<- { "return": { "status": "failed" } } + +4. Migration is being performed and is not a block migration: + +-> { "execute": "query-migrate" } +<- { + "return":{ + "status":"active", + "ram":{ + "transferred":123, + "remaining":123, + "total":246 + } + } + } + +5. Migration is being performed and is a block migration: + +-> { "execute": "query-migrate" } +<- { + "return":{ + "status":"active", + "ram":{ + "total":1057024, + "remaining":1053304, + "transferred":3720 + }, + "disk":{ + "total":20971520, + "remaining":20880384, + "transferred":91136 + } + } + } + +query-balloon +------------- + +Show balloon information. + +Make an asynchronous request for balloon info. When the request completes a +json-object will be returned containing the following data: + +- "actual": current balloon value in bytes (json-int) +- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional) +- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional) +- "major_page_faults": Number of major faults (json-int, optional) +- "minor_page_faults": Number of minor faults (json-int, optional) +- "free_mem": Total amount of free and unused memory in + bytes (json-int, optional) +- "total_mem": Total amount of available memory in bytes (json-int, optional) + +Example: + +-> { "execute": "query-balloon" } +<- { + "return":{ + "actual":1073741824, + "mem_swapped_in":0, + "mem_swapped_out":0, + "major_page_faults":142, + "minor_page_faults":239245, + "free_mem":1014185984, + "total_mem":1044668416 + } + } + diff -Naur qemu-kvm-0.13.0/block/raw-win32.c qemu-0.13.0-patched/block/raw-win32.c --- qemu-kvm-0.13.0/block/raw-win32.c 2010-10-14 11:06:47.000000000 -0400 +++ qemu-0.13.0-patched/block/raw-win32.c 2011-06-19 16:47:47.000000000 -0400 @@ -93,7 +93,7 @@ else if (!(flags & BDRV_O_CACHE_WB)) overlapped |= FILE_FLAG_WRITE_THROUGH; s->hfile = CreateFile(filename, access_flags, - FILE_SHARE_READ, NULL, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, overlapped, NULL); if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); @@ -347,7 +347,7 @@ else if (!(flags & BDRV_O_CACHE_WB)) overlapped |= FILE_FLAG_WRITE_THROUGH; s->hfile = CreateFile(filename, access_flags, - FILE_SHARE_READ, NULL, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, create_flags, overlapped, NULL); if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); diff -Naur qemu-kvm-0.13.0/config-all-devices.mak qemu-0.13.0-patched/config-all-devices.mak --- qemu-kvm-0.13.0/config-all-devices.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/config-all-devices.mak 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,23 @@ +CONFIG_ACPI=y +CONFIG_APM=y +CONFIG_DMA=y +CONFIG_FDC=y +CONFIG_I8254=y +CONFIG_IDE_CORE=y +CONFIG_IDE_ISA=y +CONFIG_IDE_PCI=y +CONFIG_IDE_PIIX=y +CONFIG_IDE_QDEV=y +CONFIG_NE2000_ISA=y +CONFIG_PARALLEL=y +CONFIG_PCKBD=y +CONFIG_PCSPK=y +CONFIG_PIIX_PCI=y +CONFIG_SERIAL=y +CONFIG_SOUND=y +CONFIG_USB_OHCI=y +CONFIG_USB_UHCI=y +CONFIG_VGA_ISA=y +CONFIG_VGA_PCI=y +CONFIG_VIRTIO_PCI=y +CONFIG_VMWARE_VGA=y diff -Naur qemu-kvm-0.13.0/config-host.h qemu-0.13.0-patched/config-host.h --- qemu-kvm-0.13.0/config-host.h 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/config-host.h 2011-06-19 16:52:33.000000000 -0400 @@ -0,0 +1,57 @@ +/* Automatically generated by create_config - do not modify */ +#define CONFIG_QEMU_PREFIX "/usr/local" +#define CONFIG_QEMU_BINDIR "/usr/local/bin" +#define CONFIG_QEMU_MANDIR "/usr/local/share/man" +#define CONFIG_QEMU_DATADIR "/usr/local/share/qemu" +#define CONFIG_QEMU_SYSCONFDIR "/usr/local/etc" +#define CONFIG_QEMU_DOCDIR "/usr/local/share/doc/qemu" +#define CONFIG_QEMU_CONFDIR "/usr/local/etc/qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define CONFIG_POSIX 1 +#define CONFIG_LINUX 1 +#define CONFIG_SLIRP 1 +#define CONFIG_VDE 1 +#define CONFIG_AC97 1 +#define CONFIG_ES1370 1 +#define CONFIG_SB16 1 +#define CONFIG_AUDIO_DRIVERS \ + &oss_audio_driver,\ + +#define CONFIG_OSS 1 +#define CONFIG_BDRV_WHITELIST \ + NULL +#define CONFIG_VNC_TLS 1 +#define CONFIG_VNC_SASL 1 +#define CONFIG_VNC_JPEG 1 +#define CONFIG_VNC_PNG 1 +#define CONFIG_FNMATCH 1 +#define CONFIG_UUID 1 +#define QEMU_VERSION "0.13.0" +#define QEMU_PKGVERSION " (qemu-kvm-0.13.0)" +#define CONFIG_SDL 1 +#define CONFIG_CURSES 1 +#define CONFIG_ATFILE 1 +#define CONFIG_UTIMENSAT 1 +#define CONFIG_PIPE2 1 +#define CONFIG_ACCEPT4 1 +#define CONFIG_SPLICE 1 +#define CONFIG_EVENTFD 1 +#define CONFIG_FALLOCATE 1 +#define CONFIG_DUP3 1 +#define CONFIG_INOTIFY 1 +#define CONFIG_INOTIFY1 1 +#define CONFIG_BYTESWAP_H 1 +#define CONFIG_CURL 1 +#define CONFIG_BLUEZ 1 +#define CONFIG_LINUX_AIO 1 +#define CONFIG_ATTR 1 +#define CONFIG_VIRTFS 1 +#define CONFIG_IOVEC 1 +#define CONFIG_PREADV 1 +#define CONFIG_SIGNALFD 1 +#define CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT 1 +#define CONFIG_FDATASYNC 1 +#define CONFIG_CPU_EMULATION 1 +#define CONFIG_UNAME_RELEASE "" +#define CONFIG_ZERO_MALLOC 1 diff -Naur qemu-kvm-0.13.0/config-host.h-timestamp qemu-0.13.0-patched/config-host.h-timestamp --- qemu-kvm-0.13.0/config-host.h-timestamp 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/config-host.h-timestamp 2011-06-19 16:52:33.000000000 -0400 @@ -0,0 +1,57 @@ +/* Automatically generated by create_config - do not modify */ +#define CONFIG_QEMU_PREFIX "/usr/local" +#define CONFIG_QEMU_BINDIR "/usr/local/bin" +#define CONFIG_QEMU_MANDIR "/usr/local/share/man" +#define CONFIG_QEMU_DATADIR "/usr/local/share/qemu" +#define CONFIG_QEMU_SYSCONFDIR "/usr/local/etc" +#define CONFIG_QEMU_DOCDIR "/usr/local/share/doc/qemu" +#define CONFIG_QEMU_CONFDIR "/usr/local/etc/qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define CONFIG_POSIX 1 +#define CONFIG_LINUX 1 +#define CONFIG_SLIRP 1 +#define CONFIG_VDE 1 +#define CONFIG_AC97 1 +#define CONFIG_ES1370 1 +#define CONFIG_SB16 1 +#define CONFIG_AUDIO_DRIVERS \ + &oss_audio_driver,\ + +#define CONFIG_OSS 1 +#define CONFIG_BDRV_WHITELIST \ + NULL +#define CONFIG_VNC_TLS 1 +#define CONFIG_VNC_SASL 1 +#define CONFIG_VNC_JPEG 1 +#define CONFIG_VNC_PNG 1 +#define CONFIG_FNMATCH 1 +#define CONFIG_UUID 1 +#define QEMU_VERSION "0.13.0" +#define QEMU_PKGVERSION " (qemu-kvm-0.13.0)" +#define CONFIG_SDL 1 +#define CONFIG_CURSES 1 +#define CONFIG_ATFILE 1 +#define CONFIG_UTIMENSAT 1 +#define CONFIG_PIPE2 1 +#define CONFIG_ACCEPT4 1 +#define CONFIG_SPLICE 1 +#define CONFIG_EVENTFD 1 +#define CONFIG_FALLOCATE 1 +#define CONFIG_DUP3 1 +#define CONFIG_INOTIFY 1 +#define CONFIG_INOTIFY1 1 +#define CONFIG_BYTESWAP_H 1 +#define CONFIG_CURL 1 +#define CONFIG_BLUEZ 1 +#define CONFIG_LINUX_AIO 1 +#define CONFIG_ATTR 1 +#define CONFIG_VIRTFS 1 +#define CONFIG_IOVEC 1 +#define CONFIG_PREADV 1 +#define CONFIG_SIGNALFD 1 +#define CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT 1 +#define CONFIG_FDATASYNC 1 +#define CONFIG_CPU_EMULATION 1 +#define CONFIG_UNAME_RELEASE "" +#define CONFIG_ZERO_MALLOC 1 diff -Naur qemu-kvm-0.13.0/config-host.ld qemu-0.13.0-patched/config-host.ld --- qemu-kvm-0.13.0/config-host.ld 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/config-host.ld 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1 @@ +SEARCH_DIR("/usr/i686-pc-linux-gnu/lib"); SEARCH_DIR("/usr/lib/binutils/i686-pc-linux-gnu/2.20.1"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); diff -Naur qemu-kvm-0.13.0/config-host.mak qemu-0.13.0-patched/config-host.mak --- qemu-kvm-0.13.0/config-host.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/config-host.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1,90 @@ +# Automatically generated by configure - do not modify +# Configured with: './configure' +prefix=/usr/local +bindir=${prefix}/bin +mandir=${prefix}/share/man +datadir=${prefix}/share/qemu +sysconfdir=${prefix}/etc +docdir=${prefix}/share/doc/qemu +confdir=${prefix}/etc/qemu +ARCH=i386 +STRIP_OPT=-s +HOST_LONG_BITS=32 +CONFIG_POSIX=y +CONFIG_LINUX=y +CONFIG_SLIRP=y +CONFIG_VDE=y +CONFIG_AC97=y +CONFIG_ES1370=y +CONFIG_SB16=y +CONFIG_AUDIO_DRIVERS=oss +CONFIG_OSS=y +CONFIG_BDRV_WHITELIST= +CONFIG_VNC_TLS=y +VNC_TLS_CFLAGS= +CONFIG_VNC_SASL=y +VNC_SASL_CFLAGS= +CONFIG_VNC_JPEG=y +VNC_JPEG_CFLAGS= +CONFIG_VNC_PNG=y +VNC_PNG_CFLAGS= +CONFIG_FNMATCH=y +CONFIG_UUID=y +VERSION=0.13.0 +PKGVERSION= (qemu-kvm-0.13.0) +SRC_PATH=/usr/src/qemu-0.13.0 +TARGET_DIRS=x86_64-softmmu +BUILD_DOCS=yes +CONFIG_SDL=y +SDL_CFLAGS=-D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL +CONFIG_CURSES=y +CONFIG_ATFILE=y +CONFIG_UTIMENSAT=y +CONFIG_PIPE2=y +CONFIG_ACCEPT4=y +CONFIG_SPLICE=y +CONFIG_EVENTFD=y +CONFIG_FALLOCATE=y +CONFIG_DUP3=y +CONFIG_INOTIFY=y +CONFIG_INOTIFY1=y +CONFIG_BYTESWAP_H=y +CONFIG_CURL=y +CURL_CFLAGS= +CONFIG_BLUEZ=y +BLUEZ_CFLAGS= +CONFIG_LINUX_AIO=y +CONFIG_ATTR=y +CONFIG_VIRTFS=y +INSTALL_BLOBS=yes +CONFIG_IOVEC=y +CONFIG_PREADV=y +CONFIG_SIGNALFD=y +CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y +CONFIG_FDATASYNC=y +CONFIG_CPU_EMULATION=y +CONFIG_UNAME_RELEASE="" +CONFIG_ZERO_MALLOC=y +HOST_USB=linux +TOOLS=qemu-nbd$(EXESUF) qemu-img$(EXESUF) qemu-io$(EXESUF) +ROMS=optionrom +MAKE=make +INSTALL=install +INSTALL_DIR=install -d -m0755 -p +INSTALL_DATA=install -m0644 -p +INSTALL_PROG=install -m0755 -p +CC=gcc +HOST_CC=gcc +AR=ar +OBJCOPY=objcopy +LD=ld +CFLAGS=-O2 -g +QEMU_CFLAGS=-I$(SRC_PATH)/slirp -m32 -fstack-protector-all -Wold-style-definition -Wold-style-declaration -I. -I$(SRC_PATH) -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing +HELPER_CFLAGS=-fomit-frame-pointer +LDFLAGS=-Wl,--warn-common -m32 -g +ARLIBS_BEGIN= +ARLIBS_END= +LIBS+=-lrt -lattr -lpthread +LIBS_TOOLS+=-lcurl -lvdeplug -luuid -laio +EXESUF= +subdir-x86_64-softmmu: subdir-libhw64 diff -Naur qemu-kvm-0.13.0/hw/e1000.c qemu-0.13.0-patched/hw/e1000.c --- qemu-kvm-0.13.0/hw/e1000.c 2010-10-14 11:06:47.000000000 -0400 +++ qemu-0.13.0-patched/hw/e1000.c 2011-06-19 16:48:38.000000000 -0400 @@ -567,7 +567,7 @@ if (rctl & E1000_RCTL_UPE) // promiscuous return 1; - if ((buf[0] & 1) && (rctl & E1000_RCTL_MPE)) // promiscuous mcast + if (buf[0] & 1) //&& (rctl & E1000_RCTL_MPE)) // promiscuous mcast return 1; if ((rctl & E1000_RCTL_BAM) && !memcmp(buf, bcast, sizeof bcast)) diff -Naur qemu-kvm-0.13.0/libdis/config.mak qemu-0.13.0-patched/libdis/config.mak --- qemu-kvm-0.13.0/libdis/config.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/libdis/config.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1,3 @@ + +CONFIG_I386_DIS=y +CONFIG_I386_DIS=y diff -Naur qemu-kvm-0.13.0/libdis-user/config.mak qemu-0.13.0-patched/libdis-user/config.mak --- qemu-kvm-0.13.0/libdis-user/config.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/libdis-user/config.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1 @@ + diff -Naur qemu-kvm-0.13.0/libhw32/config.mak qemu-0.13.0-patched/libhw32/config.mak --- qemu-kvm-0.13.0/libhw32/config.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/libhw32/config.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1 @@ +QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=32 diff -Naur qemu-kvm-0.13.0/libhw64/config.mak qemu-0.13.0-patched/libhw64/config.mak --- qemu-kvm-0.13.0/libhw64/config.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/libhw64/config.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1 @@ +QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=64 diff -Naur qemu-kvm-0.13.0/net/udp.c qemu-0.13.0-patched/net/udp.c --- qemu-kvm-0.13.0/net/udp.c 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/net/udp.c 2011-06-19 16:49:14.000000000 -0400 @@ -0,0 +1,138 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "net/udp.h" + +#include "config-host.h" + +#ifndef _WIN32 +#include +#include +#include +#endif + +#include "net.h" +#include "qemu-char.h" +#include "qemu-common.h" +#include "qemu-option.h" +#include "qemu_socket.h" +#include "sysemu.h" + + +typedef struct UDPState { + VLANClientState nc; + int rfd; + struct sockaddr_in sender; +} UDPState; + +static void udp_to_qemu(void *opaque) +{ + UDPState *s = opaque; + uint8_t buf[4096]; + int size; + + size = recvfrom(s->rfd, (char *)buf, sizeof(buf), 0, NULL, NULL); + if (size > 0) { + qemu_send_packet(&s->nc, buf, size); + } +} + +static ssize_t udp_receive(VLANClientState *nc, const uint8_t *buf, size_t size) +{ + UDPState *s = DO_UPCAST(UDPState, nc, nc); + int ret; + + do { + ret = sendto(s->rfd, (const char *)buf, size, 0, (struct sockaddr *)&s->sender, sizeof (s->sender)); + } while (ret < 0 && errno == EINTR); + + return ret; +} + +static void udp_cleanup(VLANClientState *nc) +{ + UDPState *s = DO_UPCAST(UDPState, nc, nc); + qemu_set_fd_handler(s->rfd, NULL, NULL, NULL); + close(s->rfd); +} + +static NetClientInfo net_udp_info = { + .type = NET_CLIENT_TYPE_UDP, + .size = sizeof(UDPState), + .receive = udp_receive, + .cleanup = udp_cleanup, +}; + +static int net_udp_init(VLANState *vlan, const char *model, + const char *name, int sport, + const char *daddr, int dport) +{ + VLANClientState *nc; + UDPState *s; + struct sockaddr_in receiver; + int ret; + + nc = qemu_new_net_client(&net_udp_info, vlan, NULL, model, name); + + snprintf(nc->info_str, sizeof(nc->info_str),"udp: %i->%s:%i", + sport, daddr, dport); + + s = DO_UPCAST(UDPState, nc, nc); + + s->rfd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP); + receiver.sin_family = AF_INET; + receiver.sin_addr.s_addr = INADDR_ANY; + receiver.sin_port = htons(sport); + ret = bind(s->rfd, (struct sockaddr *)&receiver, sizeof(receiver)); + + if (ret == -1) { + fprintf (stderr, "bind error:%s\n", strerror(errno)); + return ret; + } + + memset((char*)&s->sender, sizeof(s->sender), 0); + s->sender.sin_family = AF_INET; + s->sender.sin_port = htons(dport); + inet_aton(daddr, &s->sender.sin_addr); + + qemu_set_fd_handler(s->rfd, udp_to_qemu, NULL, s); + + return 0; +} + +int net_init_udp(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan) +{ + const char *daddr; + int sport, dport; + + daddr = qemu_opt_get(opts, "daddr"); + + sport = qemu_opt_get_number(opts, "sport", 0); + dport = qemu_opt_get_number(opts, "dport", 0); + + if (net_udp_init(vlan, "udp", name, sport, daddr, dport) == -1) { + return -1; + } + + return 0; +} diff -Naur qemu-kvm-0.13.0/net/udp.h qemu-0.13.0-patched/net/udp.h --- qemu-kvm-0.13.0/net/udp.h 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/net/udp.h 2011-06-19 16:49:40.000000000 -0400 @@ -0,0 +1,32 @@ +/* + * QEMU System Emulator + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef QEMU_NET_UDP_H +#define QEMU_NET_UDP_H + +#include "qemu-common.h" +#include "qemu-option.h" + +int net_init_udp(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan); + +#endif /* QEMU_NET_UDP_H */ diff -Naur qemu-kvm-0.13.0/net.c qemu-0.13.0-patched/net.c --- qemu-kvm-0.13.0/net.c 2010-10-14 11:06:47.000000000 -0400 +++ qemu-0.13.0-patched/net.c 2011-06-19 16:50:51.000000000 -0400 @@ -30,6 +30,7 @@ #include "net/dump.h" #include "net/slirp.h" #include "net/vde.h" +#include "net/udp.h" #include "net/util.h" #include "monitor.h" #include "sysemu.h" @@ -1074,6 +1075,26 @@ }, #endif }, { + .type = "udp", + .init = net_init_udp, + .desc = { + NET_COMMON_PARAMS_DESC, + { + .name = "sport", + .type = QEMU_OPT_NUMBER, + .help = "source port number", + }, { + .name = "daddr", + .type = QEMU_OPT_STRING, + .help = "destination IP address", + }, { + .name = "dport", + .type = QEMU_OPT_NUMBER, + .help = "destination port number", + }, + { /* end of list */ } + }, + }, { .type = "dump", .init = net_init_dump, .desc = { diff -Naur qemu-kvm-0.13.0/net.h qemu-0.13.0-patched/net.h --- qemu-kvm-0.13.0/net.h 2010-10-14 11:06:47.000000000 -0400 +++ qemu-0.13.0-patched/net.h 2011-06-19 16:51:11.000000000 -0400 @@ -33,6 +33,7 @@ NET_CLIENT_TYPE_TAP, NET_CLIENT_TYPE_SOCKET, NET_CLIENT_TYPE_VDE, + NET_CLIENT_TYPE_UDP, NET_CLIENT_TYPE_DUMP } net_client_type; diff -Naur qemu-kvm-0.13.0/qemu-doc.html qemu-0.13.0-patched/qemu-doc.html --- qemu-kvm-0.13.0/qemu-doc.html 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-doc.html 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,4058 @@ + + +QEMU Emulator User Documentation + + + + + + + + + + + +

QEMU Emulator User Documentation

+ +
+

Table of Contents

+ +
+ +

+ +

1 Introduction

+ +

+ + +

1.1 Features

+ +

QEMU is a FAST! processor emulator using dynamic translation to +achieve good emulation speed. + +

QEMU has two operating modes: + + + +

    +
  • Full system emulation. In this mode, QEMU emulates a full system (for +example a PC), including one or several processors and various +peripherals. It can be used to launch different Operating Systems +without rebooting the PC or to debug system code. + +
  • User mode emulation. In this mode, QEMU can launch +processes compiled for one CPU on another CPU. It can be used to +launch the Wine Windows API emulator (http://www.winehq.org) or +to ease cross-compilation and cross-debugging. + +
+ +

QEMU can run without an host kernel driver and yet gives acceptable +performance. + +

For system emulation, the following hardware targets are supported: + + + +

  • PC (x86 or x86_64 processor) +
  • ISA PC (old style PC without PCI bus) +
  • PREP (PowerPC processor) +
  • G3 Beige PowerMac (PowerPC processor) +
  • Mac99 PowerMac (PowerPC processor, in progress) +
  • Sun4m/Sun4c/Sun4d (32-bit Sparc processor) +
  • Sun4u/Sun4v (64-bit Sparc processor, in progress) +
  • Malta board (32-bit and 64-bit MIPS processors) +
  • MIPS Magnum (64-bit MIPS processor) +
  • ARM Integrator/CP (ARM) +
  • ARM Versatile baseboard (ARM) +
  • ARM RealView Emulation/Platform baseboard (ARM) +
  • Spitz, Akita, Borzoi, Terrier and Tosa PDAs (PXA270 processor) +
  • Luminary Micro LM3S811EVB (ARM Cortex-M3) +
  • Luminary Micro LM3S6965EVB (ARM Cortex-M3) +
  • Freescale MCF5208EVB (ColdFire V2). +
  • Arnewsh MCF5206 evaluation board (ColdFire V2). +
  • Palm Tungsten|E PDA (OMAP310 processor) +
  • N800 and N810 tablets (OMAP2420 processor) +
  • MusicPal (MV88W8618 ARM processor) +
  • Gumstix "Connex" and "Verdex" motherboards (PXA255/270). +
  • Siemens SX1 smartphone (OMAP310 processor) +
  • Syborg SVP base model (ARM Cortex-A8). +
  • AXIS-Devboard88 (CRISv32 ETRAX-FS). +
  • Petalogix Spartan 3aDSP1800 MMU ref design (MicroBlaze). +
+ +

For user emulation, x86 (32 and 64 bit), PowerPC (32 and 64 bit), +ARM, MIPS (32 bit only), Sparc (32 and 64 bit), +Alpha, ColdFire(m68k), CRISv32 and MicroBlaze CPUs are supported. + +

+ +

2 Installation

+ +

If you want to compile QEMU yourself, see compilation. + +

+ + +

2.1 Linux

+ +

+If a precompiled package is available for your distribution - you just +have to install it. Otherwise, see compilation. + +

+ + +

2.2 Windows

+ +

+Download the experimental binary installer at +http://www.free.oszoo.org/download.html. +TODO (no longer available) + +

+ + +

2.3 Mac OS X

+ +

Download the experimental binary installer at +http://www.free.oszoo.org/download.html. +TODO (no longer available) + +

+ +

3 QEMU PC System emulator

+ +

+ +

+ + +

3.1 Introduction

+ + +

The QEMU PC System emulator simulates the +following peripherals: + +

    +
  • i440FX host PCI bridge and PIIX3 PCI to ISA bridge +
  • Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA +extensions (hardware level, including all non standard modes). +
  • PS/2 mouse and keyboard +
  • 2 PCI IDE interfaces with hard disk and CD-ROM support +
  • Floppy disk +
  • PCI and ISA network adapters +
  • Serial ports +
  • Creative SoundBlaster 16 sound card +
  • ENSONIQ AudioPCI ES1370 sound card +
  • Intel 82801AA AC97 Audio compatible sound card +
  • Adlib(OPL2) - Yamaha YM3812 compatible chip +
  • Gravis Ultrasound GF1 sound card +
  • CS4231A compatible sound card +
  • PCI UHCI USB controller and a virtual USB hub. +
+ +

SMP is supported with up to 255 CPUs. + +

Note that adlib, gus and cs4231a are only available when QEMU was +configured with –audio-card-list option containing the name(s) of +required card(s). + +

QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL +VGA BIOS. + +

QEMU uses YM3812 emulation by Tatsuyuki Satoh. + +

QEMU uses GUS emulation(GUSEMU32 http://www.deinmeister.de/gusemu/) +by Tibor "TS" Schütz. + +

Not that, by default, GUS shares IRQ(7) with parallel ports and so +qemu must be told to not have parallel ports to have working GUS + +

qemu dos.img -soundhw gus -parallel none
+
+

Alternatively: +

qemu dos.img -device gus,irq=5
+
+

Or some other unclaimed IRQ. + +

CS4231A is the chip used in Windows Sound System and GUSMAX products + + +

+ + +

3.2 Quick Start

+ +

+Download and uncompress the linux image (linux.img) and type: + +

qemu linux.img
+
+

Linux should boot and give you a prompt. + +

+ + +

3.3 Invocation

+ +

+usage: qemu [options] [disk_image]
+
+
+ +

disk_image is a raw hard disk image for IDE hard disk 0. Some +targets do not need a disk image. + +

Standard options: +

+
-h
Display help and exit +
-version
Display version information and exit +
-M machine
Select the emulated machine (-M ? for list) +
-cpu model
Select CPU model (-cpu ? for list and additional feature selection) +
-smp n[,cores=cores][,threads=threads][,sockets=sockets][,maxcpus=maxcpus]
Simulate an SMP system with n CPUs. On the PC target, up to 255 +CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs +to 4. +For the PC target, the number of cores per socket, the number +of threads per cores and the total number of sockets can be +specified. Missing values will be computed. If any on the three values is +given, the total number of CPUs n can be omitted. maxcpus +specifies the maximum number of hotpluggable CPUs. +
-numa opts
Simulate a multi node NUMA system. If mem and cpus are omitted, resources +are split equally. +
-fda file
-fdb file
Use file as floppy disk 0/1 image (see disk_images). You can +use the host floppy by using /dev/fd0 as filename (see host_drives). +
-hda file
-hdb file
-hdc file
-hdd file
Use file as hard disk 0, 1, 2 or 3 image (see disk_images). +
-cdrom file
Use file as CD-ROM image (you cannot use -hdc and +-cdrom at the same time). You can use the host CD-ROM by +using /dev/cdrom as filename (see host_drives). +
-drive option[,option[,option[,...]]]
+Define a new drive. Valid options are: + +
+
file=file
This option defines which disk image (see disk_images) to use with +this drive. If the filename contains comma, you must double it +(for instance, "file=my,,file" to use file "my,file"). +
if=interface
This option defines on which type on interface the drive is connected. +Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio. +
bus=bus,unit=unit
These options define where is connected the drive by defining the bus number and +the unit id. +
index=index
This option defines where is connected the drive by using an index in the list +of available connectors of a given interface type. +
media=media
This option defines the type of the media: disk or cdrom. +
cyls=c,heads=h,secs=s[,trans=t]
These options have the same definition as they have in -hdachs. +
snapshot=snapshot
snapshot is "on" or "off" and allows to enable snapshot for given drive (see -snapshot). +
cache=cache
cache is "none", "writeback", "unsafe", or "writethrough" and controls how the host cache is used to access block data. +
aio=aio
aio is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO. +
format=format
Specify which disk format will be used rather than detecting +the format. Can be used to specifiy format=raw to avoid interpreting +an untrusted format header. +
serial=serial
This option specifies the serial number to assign to the device. +
addr=addr
Specify the controller's PCI address (if=virtio only). +
boot=boot
boot is "on" or "off" and allows for booting from non-traditional interfaces, such as virtio. +
+ +

By default, writethrough caching is used for all block device. This means that +the host page cache will be used to read and write data but write notification +will be sent to the guest only when the data has been reported as written by +the storage subsystem. + +

Writeback caching will report data writes as completed as soon as the data is +present in the host page cache. This is safe as long as you trust your host. +If your host crashes or loses power, then the guest may experience data +corruption. + +

The host page cache can be avoided entirely with cache=none. This will +attempt to do disk IO directly to the guests memory. QEMU may still perform +an internal copy of the data. + +

Some block drivers perform badly with cache=writethrough, most notably, +qcow2. If performance is more important than correctness, +cache=writeback should be used with qcow2. + +

In case you don't care about data integrity over host failures, use +cache=unsafe. This option tells qemu that it never needs to write any data +to the disk but can instead keeps things in cache. If anything goes wrong, +like your host losing power, the disk storage getting disconnected accidently, +etc. you're image will most probably be rendered unusable. When using +the -snapshot option, unsafe caching is always used. + +

Instead of -cdrom you can use: +

     qemu -drive file=file,index=2,media=cdrom
+
+

Instead of -hda, -hdb, -hdc, -hdd, you can +use: +

     qemu -drive file=file,index=0,media=disk
+     qemu -drive file=file,index=1,media=disk
+     qemu -drive file=file,index=2,media=disk
+     qemu -drive file=file,index=3,media=disk
+
+

You can connect a CDROM to the slave of ide0: +

     qemu -drive file=file,if=ide,index=1,media=cdrom
+
+

If you don't specify the "file=" argument, you define an empty drive: +

     qemu -drive if=ide,index=1,media=cdrom
+
+

You can connect a SCSI disk with unit ID 6 on the bus #0: +

     qemu -drive file=file,if=scsi,bus=0,unit=6
+
+

Instead of -fda, -fdb, you can use: +

     qemu -drive file=file,index=0,if=floppy
+     qemu -drive file=file,index=1,if=floppy
+
+

By default, interface is "ide" and index is automatically +incremented: +

     qemu -drive file=a -drive file=b"
+
+

is interpreted like: +

     qemu -hda a -hdb b
+
+
-set
TODO +
-global
TODO +
-mtdblock file
Use file as on-board Flash memory image. +
-sd file
Use file as SecureDigital card image. +
-pflash file
Use file as a parallel flash image. +
-boot [order=drives][,once=drives][,menu=on|off]
Specify boot order drives as a string of drive letters. Valid +drive letters depend on the target achitecture. The x86 PC uses: a, b +(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot +from network adapter 1-4), hard disk boot is the default. To apply a +particular boot order only on the first startup, specify it via +once. + +

Interactive boot menus/prompts can be enabled via menu=on as far +as firmware/BIOS supports them. The default is non-interactive boot. + +

     # try to boot from network first, then from hard disk
+     qemu -boot order=nc
+     # boot from CD-ROM first, switch back to default order after reboot
+     qemu -boot once=d
+
+

Note: The legacy format '-boot drives' is still supported but its +use is discouraged as it may be removed from future versions. +

-snapshot
Write to temporary files instead of disk image files. In this case, +the raw disk image you use is not written back. You can however force +the write back by pressing <C-a s> (see disk_images). +
-m megs
Set virtual RAM size to megs megabytes. Default is 128 MiB. Optionally, +a suffix of “M” or “G” can be used to signify a value in megabytes or +gigabytes respectively. +
-mem-path path
Allocate guest RAM from a temporarily created file in path. +
-mem-prealloc
Preallocate memory when using -mem-path. +
-k language
Use keyboard layout language (for example fr for +French). This option is only needed where it is not easy to get raw PC +keycodes (e.g. on Macs, with some X11 servers or with a VNC +display). You don't normally need to use it on PC/Linux or PC/Windows +hosts. + +

The available layouts are: +

     ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
+     da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
+     de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
+
+

The default is en-us. +

-audio-help
Will show the audio subsystem help: list of drivers, tunable +parameters. +
-soundhw card1[,card2,...] or -soundhw all
Enable audio and selected sound hardware. Use ? to print all +available sound hardware. + +
     qemu -soundhw sb16,adlib disk.img
+     qemu -soundhw es1370 disk.img
+     qemu -soundhw ac97 disk.img
+     qemu -soundhw all disk.img
+     qemu -soundhw ?
+
+

Note that Linux's i810_audio OSS kernel (for AC97) module might +require manually specifying clocking. + +

     modprobe i810_audio clocking=48000
+
+
+USB options: +
+
-usb
Enable the USB driver (will be the default soon) + +
-usbdevice devname
Add the USB device devname. See usb_devices. + +
+
mouse
Virtual Mouse. This will override the PS/2 mouse emulation when activated. + +
tablet
Pointer device that uses absolute coordinates (like a touchscreen). This +means qemu is able to report the mouse position without having to grab the +mouse. Also overrides the PS/2 mouse emulation when activated. + +
disk:[format=format]:file
Mass storage device based on file. The optional format argument +will be used rather than detecting the format. Can be used to specifiy +format=raw to avoid interpreting an untrusted format header. + +
host:bus.addr
Pass through the host device identified by bus.addr (Linux only). + +
host:vendor_id:product_id
Pass through the host device identified by vendor_id:product_id +(Linux only). + +
serial:[vendorid=vendor_id][,productid=product_id]:dev
Serial converter to host character device dev, see -serial for the +available devices. + +
braille
Braille device. This will use BrlAPI to display the braille output on a real +or fake device. + +
net:options
Network adapter that supports CDC ethernet and RNDIS protocols. + +
+
-device driver[,prop[=value][,...]]
Add device driver. prop=value sets driver +properties. Valid properties depend on the driver. To get help on +possible drivers and properties, use -device ? and +-device driver,?. +File system options: + +

The general form of a File system device option is: +

+
-fsdev fstype ,id=id [,options]
Fstype is one of: +local, +The specific Fstype will determine the applicable options. + +

Options to each backend are described below. + +

-fsdev local ,id=id ,path=path ,security_model=security_model
+Create a file-system-"device" for local-filesystem. + +

local is only available on Linux. + +

path specifies the path to be exported. path is required. + +

security_model specifies the security model to be followed. +security_model is required. + +

+ Virtual File system pass-through options: + +

The general form of a Virtual File system pass-through option is: +

+
-virtfs fstype [,options]
Fstype is one of: +local, +The specific Fstype will determine the applicable options. + +

Options to each backend are described below. + +

-virtfs local ,path=path ,mount_tag=mount_tag ,security_model=security_model
+Create a Virtual file-system-pass through for local-filesystem. + +

local is only available on Linux. + +

path specifies the path to be exported. path is required. + +

security_model specifies the security model to be followed. +security_model is required. + +

mount_tag specifies the tag with which the exported file is mounted. +mount_tag is required. + +

+ +
-name name
Sets the name of the guest. +This name will be displayed in the SDL window caption. +The name will also be used for the VNC server. +Also optionally set the top visible process name in Linux. +
-uuid uuid
Set system UUID. +
+ +

Display options: +

+
-nographic
Normally, QEMU uses SDL to display the VGA output. With this option, +you can totally disable graphical output so that QEMU is a simple +command line application. The emulated serial port is redirected on +the console. Therefore, you can still use QEMU to debug a Linux kernel +with a serial console. +
-curses
Normally, QEMU uses SDL to display the VGA output. With this option, +QEMU can display the VGA output when in text mode using a +curses/ncurses interface. Nothing is displayed in graphical mode. +
-no-frame
Do not use decorations for SDL windows and start them using the whole +available screen space. This makes the using QEMU in a dedicated desktop +workspace more convenient. +
-alt-grab
Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). +
-ctrl-grab
Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). +
-no-quit
Disable SDL window close capability. +
-sdl
Enable SDL. +
-portrait
Rotate graphical output 90 deg left (only PXA LCD). +
-vga type
Select type of VGA card to emulate. Valid values for type are +
+
cirrus
Cirrus Logic GD5446 Video card. All Windows versions starting from +Windows 95 should recognize and use this graphic card. For optimal +performances, use 16 bit color depth in the guest and the host OS. +(This one is the default) +
std
Standard VGA card with Bochs VBE extensions. If your guest OS +supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want +to use high resolution modes (>= 1280x1024x16) then you should use +this option. +
vmware
VMWare SVGA-II compatible adapter. Use it if you have sufficiently +recent XFree86/XOrg server or Windows guest with a driver for this +card. +
none
Disable VGA card. +
+
-full-screen
Start in full screen. +
-g widthxheight[xdepth]
Set the initial graphical resolution and depth (PPC, SPARC only). +
-vnc display[,option[,option[,...]]]
Normally, QEMU uses SDL to display the VGA output. With this option, +you can have QEMU listen on VNC display display and redirect the VGA +display over the VNC session. It is very useful to enable the usb +tablet device when using this option (option -usbdevice +tablet). When using the VNC display, you must use the -k +parameter to set the keyboard layout if you are not using en-us. Valid +syntax for the display is + +
+
host:d
+TCP connections will only be allowed from host on display d. +By convention the TCP port is 5900+d. Optionally, host can +be omitted in which case the server will accept connections from any host. + +
unix:path
+Connections will be allowed over UNIX domain sockets where path is the +location of a unix socket to listen for connections on. + +
none
+VNC is initialized but not started. The monitor change command +can be used to later start the VNC server. + +
+ +

Following the display value there may be one or more option flags +separated by commas. Valid options are + +

+
reverse
+Connect to a listening VNC client via a “reverse” connection. The +client is specified by the display. For reverse network +connections (host:d,reverse), the d argument +is a TCP port number, not a display number. + +
password
+Require that password based authentication is used for client connections. +The password must be set separately using the change command in the +pcsys_monitor + +
tls
+Require that client use TLS when communicating with the VNC server. This +uses anonymous TLS credentials so is susceptible to a man-in-the-middle +attack. It is recommended that this option be combined with either the +x509 or x509verify options. + +
x509=/path/to/certificate/dir
+Valid if tls is specified. Require that x509 credentials are used +for negotiating the TLS session. The server will send its x509 certificate +to the client. It is recommended that a password be set on the VNC server +to provide authentication of the client when this is used. The path following +this option specifies where the x509 certificates are to be loaded from. +See the vnc_security section for details on generating certificates. + +
x509verify=/path/to/certificate/dir
+Valid if tls is specified. Require that x509 credentials are used +for negotiating the TLS session. The server will send its x509 certificate +to the client, and request that the client send its own x509 certificate. +The server will validate the client's certificate against the CA certificate, +and reject clients when validation fails. If the certificate authority is +trusted, this is a sufficient authentication mechanism. You may still wish +to set a password on the VNC server as a second authentication layer. The +path following this option specifies where the x509 certificates are to +be loaded from. See the vnc_security section for details on generating +certificates. + +
sasl
+Require that the client use SASL to authenticate with the VNC server. +The exact choice of authentication method used is controlled from the +system / user's SASL configuration file for the 'qemu' service. This +is typically found in /etc/sasl2/qemu.conf. If running QEMU as an +unprivileged user, an environment variable SASL_CONF_PATH can be used +to make it search alternate locations for the service config. +While some SASL auth methods can also provide data encryption (eg GSSAPI), +it is recommended that SASL always be combined with the 'tls' and +'x509' settings to enable use of SSL and server certificates. This +ensures a data encryption preventing compromise of authentication +credentials. See the vnc_security section for details on using +SASL authentication. + +
acl
+Turn on access control lists for checking of the x509 client certificate +and SASL party. For x509 certs, the ACL check is made against the +certificate's distinguished name. This is something that looks like +C=GB,O=ACME,L=Boston,CN=bob. For SASL party, the ACL check is +made against the username, which depending on the SASL plugin, may +include a realm component, eg bob or bob@EXAMPLE.COM. +When the acl flag is set, the initial access list will be +empty, with a deny policy. Thus no one will be allowed to +use the VNC server until the ACLs have been loaded. This can be +achieved using the acl monitor command. + +
lossy
+Enable lossy compression methods (gradient, JPEG, ...). If this +option is set, VNC client may receive lossy framebuffer updates +depending on its encoding settings. Enabling this option can save +a lot of bandwidth at the expense of quality. + +
+
+ +

i386 target only: +

+
-win2k-hack
Use it when installing Windows 2000 to avoid a disk full bug. After +Windows 2000 is installed, you no longer need this option (this option +slows down the IDE transfers). +
-no-fd-bootchk
Disable boot signature checking for floppy disks in Bochs BIOS. It may +be needed to boot from old floppy disks. +TODO: check reference to Bochs BIOS. +
-no-acpi
Disable ACPI (Advanced Configuration and Power Interface) support. Use +it if your guest OS complains about ACPI problems (PC target machine +only). +
-no-hpet
Disable HPET support. +
-balloon none
Disable balloon device. +
-balloon virtio[,addr=addr]
Enable virtio balloon device (default), optionally with PCI address +addr. +
-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]
Add ACPI table with specified header fields and context from specified files. +
-smbios file=binary
Load SMBIOS entry from binary file. + +
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
Specify SMBIOS type 0 fields + +
-smbios type=1[,manufacturer=str][,product=str] [,version=str][,serial=str][,uuid=uuid][,sku=str] [,family=str]
Specify SMBIOS type 1 fields + +
+Network options: +
+
-net nic[,vlan=n][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]
Create a new Network Interface Card and connect it to VLAN n (n += 0 is the default). The NIC is an e1000 by default on the PC +target. Optionally, the MAC address can be changed to mac, the +device address set to addr (PCI cards only), +and a name can be assigned for use in monitor commands. +Optionally, for PCI cards, you can specify the number v of MSI-X vectors +that the card should have; this option currently only affects virtio cards; set +v = 0 to disable MSI-X. If no -net option is specified, a single +NIC is created. Qemu can emulate several different models of network card. +Valid values for type are +virtio, i82551, i82557b, i82559er, +ne2k_pci, ne2k_isa, pcnet, rtl8139, +e1000, smc91c111, lance and mcf_fec. +Not all devices are supported on all targets. Use -net nic,model=? +for a list of available devices for your target. + +
-net user[,option][,option][,...]
Use the user mode network stack which requires no administrator +privilege to run. Valid options are: + +
+
vlan=n
Connect user mode stack to VLAN n (n = 0 is the default). + +
name=name
Assign symbolic name for use in monitor commands. + +
net=addr[/mask]
Set IP network address the guest will see. Optionally specify the netmask, +either in the form a.b.c.d or as number of valid top-most bits. Default is +10.0.2.0/8. + +
host=addr
Specify the guest-visible address of the host. Default is the 2nd IP in the +guest network, i.e. x.x.x.2. + +
restrict=y|yes|n|no
If this options is enabled, the guest will be isolated, i.e. it will not be +able to contact the host and no guest IP packets will be routed over the host +to the outside. This option does not affect explicitly set forwarding rule. + +
hostname=name
Specifies the client hostname reported by the builtin DHCP server. + +
dhcpstart=addr
Specify the first of the 16 IPs the built-in DHCP server can assign. Default +is the 16th to 31st IP in the guest network, i.e. x.x.x.16 to x.x.x.31. + +
dns=addr
Specify the guest-visible address of the virtual nameserver. The address must +be different from the host address. Default is the 3rd IP in the guest network, +i.e. x.x.x.3. + +
tftp=dir
When using the user mode network stack, activate a built-in TFTP +server. The files in dir will be exposed as the root of a TFTP server. +The TFTP client on the guest must be configured in binary mode (use the command +bin of the Unix TFTP client). + +
bootfile=file
When using the user mode network stack, broadcast file as the BOOTP +filename. In conjunction with tftp, this can be used to network boot +a guest from a local directory. + +

Example (using pxelinux): +

          qemu -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
+
+
smb=dir[,smbserver=addr]
When using the user mode network stack, activate a built-in SMB +server so that Windows OSes can access to the host files in dir +transparently. The IP address of the SMB server can be set to addr. By +default the 4th IP in the guest network is used, i.e. x.x.x.4. + +

In the guest Windows OS, the line: +

          10.0.2.4 smbserver
+
+

must be added in the file C:\WINDOWS\LMHOSTS (for windows 9x/Me) +or C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS (Windows NT/2000). + +

Then dir can be accessed in \\smbserver\qemu. + +

Note that a SAMBA server must be installed on the host OS in +/usr/sbin/smbd. QEMU was tested successfully with smbd versions from +Red Hat 9, Fedora Core 3 and OpenSUSE 11.x. + +

hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
Redirect incoming TCP or UDP connections to the host port hostport to +the guest IP address guestaddr on guest port guestport. If +guestaddr is not specified, its value is x.x.x.15 (default first address +given by the built-in DHCP server). By specifying hostaddr, the rule can +be bound to a specific host interface. If no connection type is set, TCP is +used. This option can be given multiple times. + +

For example, to redirect host X11 connection from screen 1 to guest +screen 0, use the following: + +

          # on the host
+          qemu -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
+          # this host xterm should open in the guest X11 server
+          xterm -display :1
+
+

To redirect telnet connections from host port 5555 to telnet port on +the guest, use the following: + +

          # on the host
+          qemu -net user,hostfwd=tcp::5555-:23 [...]
+          telnet localhost 5555
+
+

Then when you use on the host telnet localhost 5555, you +connect to the guest telnet server. + +

guestfwd=[tcp]:server:port-dev
Forward guest TCP connections to the IP address server on port port +to the character device dev. This option can be given multiple times. + +
+ +

Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still +processed and applied to -net user. Mixing them with the new configuration +syntax gives undefined results. Their use for new applications is discouraged +as they will be removed from future versions. + +

-net tap[,vlan=n][,name=name][,fd=h][,ifname=name] [,script=file][,downscript=dfile]
Connect the host TAP network interface name to VLAN n, use +the network script file to configure it and the network script +dfile to deconfigure it. If name is not provided, the OS +automatically provides one. fd=h can be used to specify +the handle of an already opened host TAP interface. The default network +configure script is /etc/qemu-ifup and the default network +deconfigure script is /etc/qemu-ifdown. Use script=no +or downscript=no to disable script execution. Example: + +
     qemu linux.img -net nic -net tap
+
+

More complicated example (two NICs, each one connected to a TAP device) +

     qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
+     -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
+
+
-net socket[,vlan=n][,name=name][,fd=h] [,listen=[host]:port][,connect=host:port]
+Connect the VLAN n to a remote VLAN in another QEMU virtual +machine using a TCP socket connection. If listen is +specified, QEMU waits for incoming connections on port +(host is optional). connect is used to connect to +another QEMU instance using the listen option. fd=h +specifies an already opened TCP socket. + +

Example: +

     # launch a first QEMU instance
+     qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
+     -net socket,listen=:1234
+     # connect the VLAN 0 of this instance to the VLAN 0
+     # of the first instance
+     qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
+     -net socket,connect=127.0.0.1:1234
+
+
-net socket[,vlan=n][,name=name][,fd=h] [,mcast=maddr:port]
+Create a VLAN n shared with another QEMU virtual +machines using a UDP multicast socket, effectively making a bus for +every QEMU with same multicast address maddr and port. +NOTES: +
    +
  1. Several QEMU can be running on different hosts and share same bus (assuming +correct multicast setup for these hosts). +
  2. mcast support is compatible with User Mode Linux (argument ethN=mcast), see +http://user-mode-linux.sf.net. +
  3. Use fd=h to specify an already opened UDP multicast socket. +
+ +

Example: +

     # launch one QEMU instance
+     qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
+     -net socket,mcast=230.0.0.1:1234
+     # launch another QEMU instance on same "bus"
+     qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \
+     -net socket,mcast=230.0.0.1:1234
+     # launch yet another QEMU instance on same "bus"
+     qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \
+     -net socket,mcast=230.0.0.1:1234
+
+

Example (User Mode Linux compat.): +

     # launch QEMU instance (note mcast address selected
+     # is UML's default)
+     qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \
+     -net socket,mcast=239.192.168.1:1102
+     # launch UML
+     /path/to/linux ubd0=/path/to/root_fs eth0=mcast
+
+
-net vde[,vlan=n][,name=name][,sock=socketpath] [,port=n][,group=groupname][,mode=octalmode]
Connect VLAN n to PORT n of a vde switch running on host and +listening for incoming connections on socketpath. Use GROUP groupname +and MODE octalmode to change default ownership and permissions for +communication port. This option is available only if QEMU has been compiled +with vde support enabled. + +

Example: +

     # launch vde switch
+     vde_switch -F -sock /tmp/myswitch
+     # launch QEMU instance
+     qemu linux.img -net nic -net vde,sock=/tmp/myswitch
+
+
-net dump[,vlan=n][,file=file][,len=len]
Dump network traffic on VLAN n to file file (qemu-vlan0.pcap by default). +At most len bytes (64k by default) per packet are stored. The file format is +libpcap, so it can be analyzed with tools such as tcpdump or Wireshark. + +
-net none
Indicate that no network devices should be configured. It is used to +override the default configuration (-net nic -net user) which +is activated if no -net options are provided. + +
+ +

Character device options: + +

The general form of a character device option is: +

+
-chardev backend ,id=id [,mux=on|off] [,options]
Backend is one of: +null, +socket, +udp, +msmouse, +vc, +file, +pipe, +console, +serial, +pty, +stdio, +braille, +tty, +parport. +The specific backend will determine the applicable options. + +

All devices must have an id, which can be any string up to 127 characters long. +It is used to uniquely identify this device in other command line directives. + +

A character device may be used in multiplexing mode by multiple front-ends. +The key sequence of <Control-a> and <c> will rotate the input focus +between attached front-ends. Specify mux=on to enable this mode. + +

Options to each backend are described below. + +

-chardev null ,id=id
A void device. This device will not emit any data, and will drop any data it +receives. The null backend does not take any options. + +
-chardev socket ,id=id [TCP options or unix options] [,server] [,nowait] [,telnet]
+Create a two-way stream socket, which can be either a TCP or a unix socket. A +unix socket will be created if path is specified. Behaviour is +undefined if TCP options are specified for a unix socket. + +

server specifies that the socket shall be a listening socket. + +

nowait specifies that QEMU should not block waiting for a client to +connect to a listening socket. + +

telnet specifies that traffic on the socket should interpret telnet +escape sequences. + +

TCP and unix socket options are given below: + +

+
TCP options: port=port [,host=host] [,to=to] [,ipv4] [,ipv6] [,nodelay]
+host for a listening socket specifies the local address to be bound. +For a connecting socket species the remote host to connect to. host is +optional for listening sockets. If not specified it defaults to 0.0.0.0. + +

port for a listening socket specifies the local port to be bound. For a +connecting socket specifies the port on the remote host to connect to. +port can be given as either a port number or a service name. +port is required. + +

to is only relevant to listening sockets. If it is specified, and +port cannot be bound, QEMU will attempt to bind to subsequent ports up +to and including to until it succeeds. to must be specified +as a port number. + +

ipv4 and ipv6 specify that either IPv4 or IPv6 must be used. +If neither is specified the socket may use either protocol. + +

nodelay disables the Nagle algorithm. + +

unix options: path=path
+path specifies the local path of the unix socket. path is +required. + +
+ +
-chardev udp ,id=id [,host=host] ,port=port [,localaddr=localaddr] [,localport=localport] [,ipv4] [,ipv6]
+Sends all traffic from the guest to a remote host over UDP. + +

host specifies the remote host to connect to. If not specified it +defaults to localhost. + +

port specifies the port on the remote host to connect to. port +is required. + +

localaddr specifies the local address to bind to. If not specified it +defaults to 0.0.0.0. + +

localport specifies the local port to bind to. If not specified any +available local port will be used. + +

ipv4 and ipv6 specify that either IPv4 or IPv6 must be used. +If neither is specified the device may use either protocol. + +

-chardev msmouse ,id=id
+Forward QEMU's emulated msmouse events to the guest. msmouse does not +take any options. + +
-chardev vc ,id=id [[,width=width] [,height=height]] [[,cols=cols] [,rows=rows]]
+Connect to a QEMU text console. vc may optionally be given a specific +size. + +

width and height specify the width and height respectively of +the console, in pixels. + +

cols and rows specify that the console be sized to fit a text +console with the given dimensions. + +

-chardev file ,id=id ,path=path
+Log all traffic received from the guest to a file. + +

path specifies the path of the file to be opened. This file will be +created if it does not already exist, and overwritten if it does. path +is required. + +

-chardev pipe ,id=id ,path=path
+Create a two-way connection to the guest. The behaviour differs slightly between +Windows hosts and other hosts: + +

On Windows, a single duplex pipe will be created at +\\.pipe\path. + +

On other hosts, 2 pipes will be created called path.in and +path.out. Data written to path.in will be +received by the guest. Data written by the guest can be read from +path.out. QEMU will not create these fifos, and requires them to +be present. + +

path forms part of the pipe path as described above. path is +required. + +

-chardev console ,id=id
+Send traffic from the guest to QEMU's standard output. console does not +take any options. + +

console is only available on Windows hosts. + +

-chardev serial ,id=id ,path=path
+Send traffic from the guest to a serial device on the host. + +

serial is +only available on Windows hosts. + +

path specifies the name of the serial device to open. + +

-chardev pty ,id=id
+Create a new pseudo-terminal on the host and connect to it. pty does +not take any options. + +

pty is not available on Windows hosts. + +

-chardev stdio ,id=id [,signal=on|off]
Connect to standard input and standard output of the qemu process. + +

signal controls if signals are enabled on the terminal, that includes +exiting QEMU with the key sequence <Control-c>. This option is enabled by +default, use signal=off to disable it. + +

stdio is not available on Windows hosts. + +

-chardev braille ,id=id
+Connect to a local BrlAPI server. braille does not take any options. + +
-chardev tty ,id=id ,path=path
+Connect to a local tty device. + +

tty is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and +DragonFlyBSD hosts. + +

path specifies the path to the tty. path is required. + +

-chardev parport ,id=id ,path=path
+parport is only available on Linux, FreeBSD and DragonFlyBSD hosts. + +

Connect to a local parallel port. + +

path specifies the path to the parallel port device. path is +required. + +

+ +

Bluetooth(R) options: +

+
-bt hci[...]
Defines the function of the corresponding Bluetooth HCI. -bt options +are matched with the HCIs present in the chosen machine type. For +example when emulating a machine with only one HCI built into it, only +the first -bt hci[...] option is valid and defines the HCI's +logic. The Transport Layer is decided by the machine type. Currently +the machines n800 and n810 have one HCI and all other +machines have none. + +

The following three types are recognized: + +

+
-bt hci,null
(default) The corresponding Bluetooth HCI assumes no internal logic +and will not respond to any HCI commands or emit events. + +
-bt hci,host[:id]
(bluez only) The corresponding HCI passes commands / events +to / from the physical HCI identified by the name id (default: +hci0) on the computer running QEMU. Only available on bluez +capable systems like Linux. + +
-bt hci[,vlan=n]
Add a virtual, standard HCI that will participate in the Bluetooth +scatternet n (default 0). Similarly to -net +VLANs, devices inside a bluetooth network n can only communicate +with other devices in the same network (scatternet). +
+ +
-bt vhci[,vlan=n]
(Linux-host only) Create a HCI in scatternet n (default 0) attached +to the host bluetooth stack instead of to the emulated target. This +allows the host and target machines to participate in a common scatternet +and communicate. Requires the Linux vhci driver installed. Can +be used as following: + +
     qemu [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
+
+
-bt device:dev[,vlan=n]
Emulate a bluetooth device dev and place it in network n +(default 0). QEMU can only emulate one type of bluetooth devices +currently: + +
+
keyboard
Virtual wireless keyboard implementing the HIDP bluetooth profile. +
+
+ +

Linux/Multiboot boot specific: + +

When using these options, you can use a given Linux or Multiboot +kernel without installing it in the disk image. It can be useful +for easier testing of various kernels. + +

+
-kernel bzImage
Use bzImage as kernel image. The kernel can be either a Linux kernel +or in multiboot format. +
-append cmdline
Use cmdline as kernel command line +
-initrd file
Use file as initial ram disk. + +
-initrd "file1 arg=foo,file2"
+This syntax is only available with multiboot. + +

Use file1 and file2 as modules and pass arg=foo as parameter to the +first module. +

+ +

Debug/Expert options: +

+
-serial dev
Redirect the virtual serial port to host character device +dev. The default device is vc in graphical mode and +stdio in non graphical mode. + +

This option can be used several times to simulate up to 4 serial +ports. + +

Use -serial none to disable all serial ports. + +

Available character devices are: +

+
vc[:WxH]
Virtual console. Optionally, a width and height can be given in pixel with +
          vc:800x600
+
+

It is also possible to specify width or height in characters: +

          vc:80Cx24C
+
+
pty
[Linux only] Pseudo TTY (a new PTY is automatically allocated) +
none
No device is allocated. +
null
void device +
/dev/XXX
[Linux only] Use host tty, e.g. /dev/ttyS0. The host serial port +parameters are set according to the emulated ones. +
/dev/parportN
[Linux only, parallel port only] Use host parallel port +N. Currently SPP and EPP parallel port features can be used. +
file:filename
Write output to filename. No character can be read. +
stdio
[Unix only] standard input/output +
pipe:filename
name pipe filename +
COMn
[Windows only] Use host serial port n +
udp:[remote_host]:remote_port[@[src_ip]:src_port]
This implements UDP Net Console. +When remote_host or src_ip are not specified +they default to 0.0.0.0. +When not using a specified src_port a random port is automatically chosen. + +

If you just want a simple readonly console you can use netcat or +nc, by starting qemu with: -serial udp::4555 and nc as: +nc -u -l -p 4555. Any time qemu writes something to that port it +will appear in the netconsole session. + +

If you plan to send characters back via netconsole or you want to stop +and start qemu a lot of times, you should have qemu use the same +source port each time by using something like -serial +udp::4555@:4556 to qemu. Another approach is to use a patched +version of netcat which can listen to a TCP port and send and receive +characters via udp. If you have a patched version of netcat which +activates telnet remote echo and single char transfer, then you can +use the following options to step up a netcat redirector to allow +telnet on port 5555 to access the qemu port. +

+
Qemu Options:
-serial udp::4555@:4556 +
netcat options:
-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T +
telnet options:
localhost 5555 +
+ +
tcp:[host]:port[,server][,nowait][,nodelay]
The TCP Net Console has two modes of operation. It can send the serial +I/O to a location or wait for a connection from a location. By default +the TCP Net Console is sent to host at the port. If you use +the server option QEMU will wait for a client socket application +to connect to the port before continuing, unless the nowait +option was specified. The nodelay option disables the Nagle buffering +algorithm. If host is omitted, 0.0.0.0 is assumed. Only +one TCP connection at a time is accepted. You can use telnet to +connect to the corresponding character device. +
+
Example to send tcp console to 192.168.0.2 port 4444
-serial tcp:192.168.0.2:4444 +
Example to listen and wait on port 4444 for connection
-serial tcp::4444,server +
Example to not wait and listen on ip 192.168.0.100 port 4444
-serial tcp:192.168.0.100:4444,server,nowait +
+ +
telnet:host:port[,server][,nowait][,nodelay]
The telnet protocol is used instead of raw tcp sockets. The options +work the same as if you had specified -serial tcp. The +difference is that the port acts like a telnet server or client using +telnet option negotiation. This will also allow you to send the +MAGIC_SYSRQ sequence if you use a telnet that supports sending the break +sequence. Typically in unix telnet you do it with Control-] and then +type "send break" followed by pressing the enter key. + +
unix:path[,server][,nowait]
A unix domain socket is used instead of a tcp socket. The option works the +same as if you had specified -serial tcp except the unix domain socket +path is used for connections. + +
mon:dev_string
This is a special option to allow the monitor to be multiplexed onto +another serial port. The monitor is accessed with key sequence of +<Control-a> and then pressing <c>. See monitor access +pcsys_keys in the -nographic section for more keys. +dev_string should be any one of the serial devices specified +above. An example to multiplex the monitor onto a telnet server +listening on port 4444 would be: +
+
-serial mon:telnet::4444,server,nowait
+ +
braille
Braille device. This will use BrlAPI to display the braille output on a real +or fake device. + +
msmouse
Three button serial mouse. Configure the guest to use Microsoft protocol. +
+
-parallel dev
Redirect the virtual parallel port to host device dev (same +devices as the serial port). On Linux hosts, /dev/parportN can +be used to use hardware devices connected on the corresponding host +parallel port. + +

This option can be used several times to simulate up to 3 parallel +ports. + +

Use -parallel none to disable all parallel ports. +

-monitor dev
Redirect the monitor to host device dev (same devices as the +serial port). +The default device is vc in graphical mode and stdio in +non graphical mode. +
-qmp dev
Like -monitor but opens in 'control' mode. +
-mon chardev=[name][,mode=readline|control][,default]
Setup monitor on chardev name. +
-debugcon dev
Redirect the debug console to host device dev (same devices as the +serial port). The debug console is an I/O port which is typically port +0xe9; writing to that I/O port sends output to this device. +The default device is vc in graphical mode and stdio in +non graphical mode. +
-pidfile file
Store the QEMU process PID in file. It is useful if you launch QEMU +from a script. +
-singlestep
Run the emulation in single step mode. +
-S
Do not start CPU at startup (you must type 'c' in the monitor). +
-gdb dev
Wait for gdb connection on device dev (see gdb_usage). Typical +connections will likely be TCP-based, but also UDP, pseudo TTY, or even +stdio are reasonable use case. The latter is allowing to start qemu from +within gdb and establish the connection via a pipe: +
     (gdb) target remote | exec qemu -gdb stdio ...
+
+
-s
Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 +(see gdb_usage). +
-d
Output log in /tmp/qemu.log +
-hdachs c,h,s,[,t]
Force hard disk 0 physical geometry (1 <= c <= 16383, 1 <= +h <= 16, 1 <= s <= 63) and optionally force the BIOS +translation mode (t=none, lba or auto). Usually QEMU can guess +all those parameters. This option is useful for old MS-DOS disk +images. +
-L path
Set the directory for the BIOS, VGA BIOS and keymaps. +
-bios file
Set the filename for the BIOS. +
-enable-kvm
Enable KVM full virtualization support. This option is only available +if KVM support is enabled when compiling. +
-xen-domid id
Specify xen guest domain id (XEN only). +
-xen-create
Create domain using xen hypercalls, bypassing xend. +Warning: should not be used when xend is in use (XEN only). +
-xen-attach
Attach to existing xen domain. +xend will use this when starting qemu (XEN only). +
-no-reboot
Exit instead of rebooting. +
-no-shutdown
Don't exit QEMU on guest shutdown, but instead only stop the emulation. +This allows for instance switching to monitor to commit changes to the +disk image. +
-loadvm file
Start right away with a saved state (loadvm in monitor) +
-daemonize
Daemonize the QEMU process after initialization. QEMU will not detach from +standard IO until it is ready to receive connections on any of its devices. +This option is a useful way for external programs to launch QEMU without having +to cope with initialization race conditions. +
-option-rom file
Load the contents of file as an option ROM. +This option is useful to load things like EtherBoot. +
-clock method
Force the use of the given methods for timer alarm. To see what timers +are available use -clock ?. + +
-rtc [base=utc|localtime|date][,clock=host|vm][,driftfix=none|slew]
Specify base as utc or localtime to let the RTC start at the current +UTC or local time, respectively. localtime is required for correct date in +MS-DOS or Windows. To start at a specific point in time, provide date in the +format 2006-06-17T16:01:21 or 2006-06-17. The default base is UTC. + +

By default the RTC is driven by the host system time. This allows to use the +RTC as accurate reference clock inside the guest, specifically if the host +time is smoothly following an accurate external reference clock, e.g. via NTP. +If you want to isolate the guest time from the host, even prevent it from +progressing during suspension, you can set clock to vm instead. + +

Enable driftfix (i386 targets only) if you experience time drift problems, +specifically with Windows' ACPI HAL. This option will try to figure out how +many timer interrupts were not processed by the Windows guest and will +re-inject them. +

-icount [N|auto]
Enable virtual instruction counter. The virtual cpu will execute one +instruction every 2^N ns of virtual time. If auto is specified +then the virtual cpu speed will be automatically adjusted to keep virtual +time within a few seconds of real time. + +

Note that while this option can give deterministic behavior, it does not +provide cycle accurate emulation. Modern CPUs contain superscalar out of +order cores with complex cache hierarchies. The number of instructions +executed often has little or no correlation with actual performance. +

-watchdog model
Create a virtual hardware watchdog device. Once enabled (by a guest +action), the watchdog must be periodically polled by an agent inside +the guest or else the guest will be restarted. + +

The model is the model of hardware watchdog to emulate. Choices +for model are: ib700 (iBASE 700) which is a very simple ISA +watchdog with a single timer, or i6300esb (Intel 6300ESB I/O +controller hub) which is a much more featureful PCI-based dual-timer +watchdog. Choose a model for which your guest has drivers. + +

Use -watchdog ? to list available hardware models. Only one +watchdog can be enabled for a guest. +

-watchdog-action action
+The action controls what QEMU will do when the watchdog timer +expires. +The default is +reset (forcefully reset the guest). +Other possible actions are: +shutdown (attempt to gracefully shutdown the guest), +poweroff (forcefully poweroff the guest), +pause (pause the guest), +debug (print a debug message and continue), or +none (do nothing). + +

Note that the shutdown action requires that the guest responds +to ACPI signals, which it may not be able to do in the sort of +situations where the watchdog would have expired, and thus +-watchdog-action shutdown is not recommended for production use. + +

Examples: + +

+
-watchdog i6300esb -watchdog-action pause
-watchdog ib700
+ +
-echr numeric_ascii_value
Change the escape character used for switching to the monitor when using +monitor and serial sharing. The default is 0x01 when using the +-nographic option. 0x01 is equal to pressing +Control-a. You can select a different character from the ascii +control keys where 1 through 26 map to Control-a through Control-z. For +instance you could use the either of the following to change the escape +character to Control-t. +
+
-echr 0x14
-echr 20
+
-virtioconsole c
Set virtio console. + +

This option is maintained for backward compatibility. + +

Please use -device virtconsole for the new way of invocation. +

-show-cursor
Show cursor. +
-tb-size n
Set TB size. +
-incoming port
Prepare for incoming migration, listen on port. +
-nodefaults
Don't create default devices. +
-chroot dir
Immediately before starting guest execution, chroot to the specified +directory. Especially useful in combination with -runas. +
-runas user
Immediately before starting guest execution, drop root privileges, switching +to the specified user. +
-prom-env variable=value
Set OpenBIOS nvram variable to given value (PPC, SPARC only). +
-semihosting
Semihosting mode (ARM, M68K only). +
-old-param
Old param mode (ARM only). +
-readconfig file
Read device configuration from file. +
-writeconfig file
Write device configuration to file. +
-nodefconfig
Normally QEMU loads a configuration file from sysconfdir/qemu.conf and +sysconfdir/target-ARCH.conf on startup. The -nodefconfig +option will prevent QEMU from loading these configuration files at startup. +
+ + +

+ + +

3.4 Keys

+ + +

During the graphical emulation, you can use the following keys: +

+
<Ctrl-Alt-f>
Toggle full screen + +
<Ctrl-Alt-u>
Restore the screen's un-scaled dimensions + +
<Ctrl-Alt-n>
Switch to virtual console 'n'. Standard console mappings are: +
+
1
Target system display +
2
Monitor +
3
Serial port +
+ +
<Ctrl-Alt>
Toggle mouse and keyboard grab. +
+ +

In the virtual consoles, you can use <Ctrl-Up>, <Ctrl-Down>, +<Ctrl-PageUp> and <Ctrl-PageDown> to move in the back log. + +

During emulation, if you are using the -nographic option, use +<Ctrl-a h> to get terminal commands: + +

+
<Ctrl-a h>

<Ctrl-a ?>
Print this help +
<Ctrl-a x>
Exit emulator +
<Ctrl-a s>
Save disk data back to file (if -snapshot) +
<Ctrl-a t>
Toggle console timestamps +
<Ctrl-a b>
Send break (magic sysrq in Linux) +
<Ctrl-a c>
Switch between console and monitor +
<Ctrl-a Ctrl-a>
Send Ctrl-a +
+ + +

+ + +

3.5 QEMU Monitor

+ +

+The QEMU monitor is used to give complex commands to the QEMU +emulator. You can use it to: + +

    +
  • Remove or insert removable media images +(such as CD-ROM or floppies). + +
  • Freeze/unfreeze the Virtual Machine (VM) and save or restore its state +from a disk file. + +
  • Inspect the VM state without an external debugger. + +
+ +

3.5.1 Commands

+ +

The following commands are available: + +

+
help or ? [cmd]
Show the help for all commands or just for command cmd. +
commit
Commit changes to the disk images (if -snapshot is used) or backing files. +
q or quit
Quit the emulator. +
eject [-f] device
Eject a removable medium (use -f to force it). +
change device setting
+Change the configuration of a device. + +
+
change diskdevice filename [format]
Change the medium for a removable disk device to point to filename. eg + +
          (qemu) change ide1-cd0 /path/to/some.iso
+
+

format is optional. + +

change vnc display,options
Change the configuration of the VNC server. The valid syntax for display +and options are described at sec_invocation. eg + +
          (qemu) change vnc localhost:1
+
+
change vnc password [password]
+Change the password associated with the VNC server. If the new password is not +supplied, the monitor will prompt for it to be entered. VNC passwords are only +significant up to 8 letters. eg + +
          (qemu) change vnc password
+          Password: ********
+
+
+
screendump filename
Save screen into PPM image filename. +
logfile filename
Output logs to filename. +
log item1[,...]
Activate logging of the specified items to /tmp/qemu.log. +
savevm [tag|id]
Create a snapshot of the whole virtual machine. If tag is +provided, it is used as human readable identifier. If there is already +a snapshot with the same tag or ID, it is replaced. More info at +vm_snapshots. +
loadvm tag|id
Set the whole virtual machine to the snapshot identified by the tag +tag or the unique snapshot ID id. +
delvm tag|id
Delete the snapshot identified by tag or id. +
singlestep [off]
Run the emulation in single step mode. +If called with option off, the emulation returns to normal mode. +
stop
Stop emulation. +
c or cont
Resume emulation. +
gdbserver [port]
Start gdbserver session (default port=1234) +
x/fmt addr
Virtual memory dump starting at addr. +
xp /fmt addr
Physical memory dump starting at addr. + +

fmt is a format which tells the command how to format the +data. Its syntax is: /{count}{format}{size} + +

+
count
is the number of items to be dumped. + +
format
can be x (hex), d (signed decimal), u (unsigned decimal), o (octal), +c (char) or i (asm instruction). + +
size
can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86, +h or w can be specified with the i format to +respectively select 16 or 32 bit code instruction size. + +
+ +

Examples: +

    +
  • Dump 10 instructions at the current instruction pointer: +
              (qemu) x/10i $eip
    +          0x90107063:  ret
    +          0x90107064:  sti
    +          0x90107065:  lea    0x0(%esi,1),%esi
    +          0x90107069:  lea    0x0(%edi,1),%edi
    +          0x90107070:  ret
    +          0x90107071:  jmp    0x90107080
    +          0x90107073:  nop
    +          0x90107074:  nop
    +          0x90107075:  nop
    +          0x90107076:  nop
    +
    +
  • Dump 80 16 bit values at the start of the video memory. +
              (qemu) xp/80hx 0xb8000
    +          0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
    +          0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
    +          0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
    +          0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
    +          0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
    +          0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
    +          0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
    +          0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
    +          0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
    +          0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
    +
    +
+
p or print/fmt expr
+Print expression value. Only the format part of fmt is +used. +Read I/O port. +Write to I/O port. +
sendkey keys
+Send keys to the emulator. keys could be the name of the +key or # followed by the raw value in either decimal or hexadecimal +format. Use - to press several keys simultaneously. Example: +
     sendkey ctrl-alt-f1
+
+

This command is useful to send keys that your graphical user interface +intercepts at low level, such as ctrl-alt-f1 in X Window. +

system_reset
+Reset the system. +
system_powerdown
+Power down the system (if supported). +
sum addr size
+Compute the checksum of a memory region. +
usb_add devname
+Add the USB device devname. For details of available devices see +usb_devices +
usb_del devname
+Remove the USB device devname from the QEMU virtual USB +hub. devname has the syntax bus.addr. Use the monitor +command info usb to see the devices you can remove. +
device_add config
+Add device. +
device_del id
+Remove device id. +
cpu index
Set the default CPU. +
mouse_move dx dy [dz]
Move the active mouse to the specified coordinates dx dy +with optional scroll axis dz. +
mouse_button val
Change the active mouse button state val (1=L, 2=M, 4=R). +
mouse_set index
Set which mouse device receives events at given index, index +can be obtained with +
     info mice
+
+
wavcapture filename [frequency [bits [channels]]]
Capture audio into filename. Using sample rate frequency +bits per sample bits and number of channels channels. + +

Defaults: +

    +
  • Sample rate = 44100 Hz - CD quality +
  • Bits = 16 +
  • Number of channels = 2 - Stereo +
+
stopcapture index
Stop capture with a given index, index can be obtained with +
     info capture
+
+
memsave addr size file
save to disk virtual memory dump starting at addr of size size. +
pmemsave addr size file
save to disk physical memory dump starting at addr of size size. +
boot_set bootdevicelist
+Define new values for the boot device list. Those values will override +the values specified on the command line through the -boot option. + +

The values that can be specified here depend on the machine type, but are +the same that can be specified in the -boot command line option. +

nmi cpu
Inject an NMI on the given CPU (x86 only). +
migrate [-d] [-b] [-i] uri
Migrate to uri (using -d to not wait for completion). +-b for migration with full copy of disk +-i for migration with incremental copy of disk (base image is shared) +
migrate_cancel
Cancel the current VM migration. +
migrate_set_speed value
Set maximum speed to value (in bytes) for migrations. +
migrate_set_downtime second
Set maximum tolerated downtime (in seconds) for migration. +
drive_add
Add drive to PCI storage controller. +
pci_add
Hot-add PCI device. +
pci_del
Hot remove PCI device. +
host_net_add
Add host VLAN client. +
host_net_remove
Remove host VLAN client. +
netdev_add
Add host network device. +
netdev_del
Remove host network device. +
hostfwd_add
Redirect TCP or UDP connections from host to guest (requires -net user). +
hostfwd_remove
Remove host-to-guest TCP or UDP redirection. +
balloon value
Request VM to change its memory allocation to value (in MB). +
set_link name [on|off]
Switch link name on (i.e. up) or off (i.e. down). +
watchdog_action
Change watchdog action. +
acl_show aclname
List all the matching rules in the access control list, and the default +policy. There are currently two named access control lists, +vnc.x509dname and vnc.username matching on the x509 client +certificate distinguished name, and SASL username respectively. +
acl_policy aclname allow|deny
Set the default access control list policy, used in the event that +none of the explicit rules match. The default policy at startup is +always deny. +
acl_add aclname match allow|deny [index]
Add a match rule to the access control list, allowing or denying access. +The match will normally be an exact username or x509 distinguished name, +but can optionally include wildcard globs. eg *@EXAMPLE.COM to +allow all users in the EXAMPLE.COM kerberos realm. The match will +normally be appended to the end of the ACL, but can be inserted +earlier in the list if the optional index parameter is supplied. +
acl_remove aclname match
Remove the specified match rule from the access control list. +
acl_reset aclname
Remove all matches from the access control list, and set the default +policy back to deny. +
mce cpu bank status mcgstatus addr misc
Inject an MCE on the given CPU (x86 only). +
getfd fdname
If a file descriptor is passed alongside this command using the SCM_RIGHTS +mechanism on unix sockets, it is stored using the name fdname for +later use by other monitor commands. +
closefd fdname
Close the file descriptor previously assigned to fdname using the +getfd command. This is only needed if the file descriptor was never +used by another monitor command. +
block_passwd device password
Set the encrypted device device password to password +
cpu_set cpu [online|offline]
Set CPU cpu online or offline. +
qmp_capabilities
Enable the specified QMP capabilities +
info subcommand
Show various information about the system state. + +
+
info version
show the version of QEMU +
info commands
list QMP available commands +
info network
show the various VLANs and the associated devices +
info chardev
show the character devices +
info block
show the block devices +
info blockstats
show block device statistics +
info registers
show the cpu registers +
info cpus
show infos for each CPU +
info history
show the command line history +
info irq
show the interrupts statistics (if available) +
info pic
show i8259 (PIC) state +
info pci
show emulated PCI device info +
info tlb
show virtual to physical memory mappings (i386 only) +
info mem
show the active virtual memory mappings (i386 only) +
info jit
show dynamic compiler info +
info kvm
show KVM information +
info numa
show NUMA information +
info kvm
show KVM information +
info usb
show USB devices plugged on the virtual USB hub +
info usbhost
show all USB host devices +
info profile
show profiling information +
info capture
show information about active capturing +
info snapshots
show list of VM snapshots +
info status
show the current VM status (running|paused) +
info pcmcia
show guest PCMCIA status +
info mice
show which guest mouse is receiving events +
info vnc
show the vnc server status +
info name
show the current VM name +
info uuid
show the current VM UUID +
info cpustats
show CPU statistics +
info usernet
show user network stack connection states +
info migrate
show migration status +
info balloon
show balloon information +
info qtree
show device tree +
info qdm
show qdev device model list +
info roms
show roms +
+
+ +

3.5.2 Integer expressions

+ +

The monitor understands integers expressions for every integer +argument. You can use register names to get the value of specifics +CPU registers by prefixing them with $. + +

+ + +

3.6 Disk Images

+ +

Since version 0.6.1, QEMU supports many disk image formats, including +growable disk images (their size increase as non empty sectors are +written), compressed and encrypted disk images. Version 0.8.3 added +the new qcow2 disk image format which is essential to support VM +snapshots. + +

+ + +

3.6.1 Quick start for disk image creation

+ +

You can create a disk image with the command: +

qemu-img create myimage.img mysize
+
+

where myimage.img is the disk image filename and mysize is its +size in kilobytes. You can add an M suffix to give the size in +megabytes and a G suffix for gigabytes. + +

See qemu_img_invocation for more information. + +

+ + +

3.6.2 Snapshot mode

+ +

If you use the option -snapshot, all disk images are +considered as read only. When sectors in written, they are written in +a temporary file created in /tmp. You can however force the +write back to the raw disk images by using the commit monitor +command (or <C-a s> in the serial console). + +

+ + +

3.6.3 VM snapshots

+ +

VM snapshots are snapshots of the complete virtual machine including +CPU state, RAM, device state and the content of all the writable +disks. In order to use VM snapshots, you must have at least one non +removable and writable block device using the qcow2 disk image +format. Normally this device is the first virtual hard drive. + +

Use the monitor command savevm to create a new VM snapshot or +replace an existing one. A human readable name can be assigned to each +snapshot in addition to its numerical ID. + +

Use loadvm to restore a VM snapshot and delvm to remove +a VM snapshot. info snapshots lists the available snapshots +with their associated information: + +

(qemu) info snapshots
+Snapshot devices: hda
+Snapshot list (from hda):
+ID        TAG                 VM SIZE                DATE       VM CLOCK
+1         start                   41M 2006-08-06 12:38:02   00:00:14.954
+2                                 40M 2006-08-06 12:43:29   00:00:18.633
+3         msys                    40M 2006-08-06 12:44:04   00:00:23.514
+
+

A VM snapshot is made of a VM state info (its size is shown in +info snapshots) and a snapshot of every writable disk image. +The VM state info is stored in the first qcow2 non removable +and writable block device. The disk image snapshots are stored in +every disk image. The size of a snapshot in a disk image is difficult +to evaluate and is not shown by info snapshots because the +associated disk sectors are shared among all the snapshots to save +disk space (otherwise each snapshot would need a full copy of all the +disk images). + +

When using the (unrelated) -snapshot option +(disk_images_snapshot_mode), you can always make VM snapshots, +but they are deleted as soon as you exit QEMU. + +

VM snapshots currently have the following known limitations: +

    +
  • They cannot cope with removable devices if they are removed or +inserted after a snapshot is done. +
  • A few device drivers still have incomplete snapshot support so their +state is not saved or restored properly (in particular USB). +
+ +

+ + +

3.6.4 qemu-img Invocation

+ +

+usage: qemu-img command [command options]
+
+
+ +

The following commands are supported: + +

+
check [-f fmt] filename
create [-f fmt] [-o options] filename [size]
commit [-f fmt] filename
convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename
info [-f fmt] filename
snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename
rebase [-f fmt] [-u] -b backing_file [-F backing_fmt] filename
resize filename [+ | -]size
+ +

Command parameters: +

+
filename
is a disk image filename +
fmt
is the disk image format. It is guessed automatically in most cases. See below +for a description of the supported disk formats. + +
size
is the disk image size in bytes. Optional suffixes k or K +(kilobyte, 1024) M (megabyte, 1024k) and G (gigabyte, 1024M) +and T (terabyte, 1024G) are supported. b is ignored. + +
output_filename
is the destination disk image filename + +
output_fmt
is the destination format +
options
is a comma separated list of format specific options in a +name=value format. Use -o ? for an overview of the options supported +by the used format or see the format descriptions below for details. + +
-c
indicates that target image must be compressed (qcow format only) +
-h
with or without a command shows help and lists the supported formats +
+ +

Parameters to snapshot subcommand: + +

+
snapshot
is the name of the snapshot to create, apply or delete +
-a
applies a snapshot (revert disk to saved state) +
-c
creates a snapshot +
-d
deletes a snapshot +
-l
lists all snapshots in the given image +
+ +

Command description: + +

+
create [-f fmt] [-o options] filename [size]
+Create the new disk image filename of size size and format +fmt. Depending on the file format, you can add one or more options +that enable additional features of this format. + +

If the option backing_file is specified, then the image will record +only the differences from backing_file. No size needs to be specified in +this case. backing_file will never be modified unless you use the +commit monitor command (or qemu-img commit). + +

The size can also be specified using the size option with -o, +it doesn't need to be specified separately in this case. + +

commit [-f fmt] filename
+Commit the changes recorded in filename in its base image. + +
convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename
+Convert the disk image filename to disk image output_filename +using format output_fmt. It can be optionally compressed (-c +option) or use any format specific options like encryption (-o option). + +

Only the formats qcow and qcow2 support compression. The +compression is read-only. It means that if a compressed sector is +rewritten, then it is rewritten as uncompressed data. + +

Image conversion is also useful to get smaller image when using a +growable format such as qcow or cow: the empty sectors +are detected and suppressed from the destination image. + +

You can use the backing_file option to force the output image to be +created as a copy on write image of the specified base image; the +backing_file should have the same content as the input's base image, +however the path, image format, etc may differ. + +

info [-f fmt] filename
+Give information about the disk image filename. Use it in +particular to know the size reserved on disk which can be different +from the displayed size. If VM snapshots are stored in the disk image, +they are displayed too. + +
snapshot [-l | -a snapshot | -c snapshot | -d snapshot ] filename
+List, apply, create or delete snapshots in image filename. + +
resize filename [+ | -]size
+Change the disk image as if it had been created with size. + +

Before using this command to shrink a disk image, you MUST use file system and +partitioning tools inside the VM to reduce allocated file systems and partition +sizes accordingly. Failure to do so will result in data loss! + +

After using this command to grow a disk image, you must use file system and +partitioning tools inside the VM to actually begin using the new space on the +device. +

+ +

Supported image file formats: + +

+
raw
+Raw disk image format (default). This format has the advantage of +being simple and easily exportable to all other emulators. If your +file system supports holes (for example in ext2 or ext3 on +Linux or NTFS on Windows), then only the written sectors will reserve +space. Use qemu-img info to know the real size used by the +image or ls -ls on Unix/Linux. + +
host_device
+Host device format. This format should be used instead of raw when +converting to block devices or other devices where "holes" are not +supported. + +
qcow2
QEMU image format, the most versatile format. Use it to have smaller +images (useful if your filesystem does not supports holes, for example +on Windows), optional AES encryption, zlib based compression and +support of multiple VM snapshots. + +

Supported options: +

+
backing_file
File name of a base image (see create subcommand) +
backing_fmt
Image format of the base image +
encryption
If this option is set to on, the image is encrypted. + +

Encryption uses the AES format which is very secure (128 bit keys). Use +a long password (16 characters) to get maximum protection. + +

cluster_size
Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster +sizes can improve the image file size whereas larger cluster sizes generally +provide better performance. + +
preallocation
Preallocation mode (allowed values: off, metadata). An image with preallocated +metadata is initially larger but can improve performance when the image needs +to grow. + +
+ +
qcow
Old QEMU image format. Left for compatibility. + +

Supported options: +

+
backing_file
File name of a base image (see create subcommand) +
encryption
If this option is set to on, the image is encrypted. +
+ +
cow
User Mode Linux Copy On Write image format. Used to be the only growable +image format in QEMU. It is supported only for compatibility with +previous versions. It does not work on win32. +
vdi
VirtualBox 1.1 compatible image format. +
vmdk
VMware 3 and 4 compatible image format. + +

Supported options: +

+
backing_fmt
Image format of the base image +
compat6
Create a VMDK version 6 image (instead of version 4) +
+ +
vpc
VirtualPC compatible image format (VHD). + +
cloop
Linux Compressed Loop image, useful only to reuse directly compressed +CD-ROM images present for example in the Knoppix CD-ROMs. +
+ + +

+ + +

3.6.5 qemu-nbd Invocation

+ +

+usage: qemu-nbd [OPTION]...  filename
+
+
+ +

Export Qemu disk image using NBD protocol. + + + +

+
filename
is a disk image filename +
-p, --port=port
port to listen on (default ‘1024’) +
-o, --offset=offset
offset into the image +
-b, --bind=iface
interface to bind to (default ‘0.0.0.0’) +
-k, --socket=path
Use a unix socket with path path +
-r, --read-only
export read-only +
-P, --partition=num
only expose partition num +
-s, --snapshot
use snapshot file +
-n, --nocache
disable host cache +
-c, --connect=dev
connect filename to NBD device dev +
-d, --disconnect
disconnect the specified device +
-e, --shared=num
device can be shared by num clients (default ‘1’) +
-t, --persistent
don't exit on the last connection +
-v, --verbose
display extra debugging information +
-h, --help
display this help and exit +
-V, --version
output version information and exit +
+ + +

+ + +

3.6.6 Using host drives

+ +

In addition to disk image files, QEMU can directly access host +devices. We describe here the usage for QEMU version >= 0.8.3. + +

3.6.6.1 Linux
+ +

On Linux, you can directly use the host device filename instead of a +disk image filename provided you have enough privileges to access +it. For example, use /dev/cdrom to access to the CDROM or +/dev/fd0 for the floppy. + +

+
CD
You can specify a CDROM device even if no CDROM is loaded. QEMU has +specific code to detect CDROM insertion or removal. CDROM ejection by +the guest OS is supported. Currently only data CDs are supported. +
Floppy
You can specify a floppy device even if no floppy is loaded. Floppy +removal is currently not detected accurately (if you change floppy +without doing floppy access while the floppy is not loaded, the guest +OS will think that the same floppy is loaded). +
Hard disks
Hard disks can be used. Normally you must specify the whole disk +(/dev/hdb instead of /dev/hdb1) so that the guest OS can +see it as a partitioned disk. WARNING: unless you know what you do, it +is better to only make READ-ONLY accesses to the hard disk otherwise +you may corrupt your host data (use the -snapshot command +line option or modify the device permissions accordingly). +
+ +
3.6.6.2 Windows
+ +
+
CD
The preferred syntax is the drive letter (e.g. d:). The +alternate syntax \\.\d: is supported. /dev/cdrom is +supported as an alias to the first CDROM drive. + +

Currently there is no specific code to handle removable media, so it +is better to use the change or eject monitor commands to +change or eject media. +

Hard disks
Hard disks can be used with the syntax: \\.\PhysicalDriveN +where N is the drive number (0 is the first hard disk). + +

WARNING: unless you know what you do, it is better to only make +READ-ONLY accesses to the hard disk otherwise you may corrupt your +host data (use the -snapshot command line so that the +modifications are written in a temporary file). +

+ +
3.6.6.3 Mac OS X
+ +

/dev/cdrom is an alias to the first CDROM. + +

Currently there is no specific code to handle removable media, so it +is better to use the change or eject monitor commands to +change or eject media. + +

+ + +

3.6.7 Virtual FAT disk images

+ +

QEMU can automatically create a virtual FAT disk image from a +directory tree. In order to use it, just type: + +

qemu linux.img -hdb fat:/my_directory
+
+

Then you access access to all the files in the /my_directory +directory without having to copy them in a disk image or to export +them via SAMBA or NFS. The default access is read-only. + +

Floppies can be emulated with the :floppy: option: + +

qemu linux.img -fda fat:floppy:/my_directory
+
+

A read/write support is available for testing (beta stage) with the +:rw: option: + +

qemu linux.img -fda fat:floppy:rw:/my_directory
+
+

What you should never do: +

    +
  • use non-ASCII filenames ; +
  • use "-snapshot" together with ":rw:" ; +
  • expect it to work when loadvm'ing ; +
  • write to the FAT directory on the host system while accessing it with the guest system. +
+ +

+ + +

3.6.8 NBD access

+ +

QEMU can access directly to block device exported using the Network Block Device +protocol. + +

qemu linux.img -hdb nbd:my_nbd_server.mydomain.org:1024
+
+

If the NBD server is located on the same host, you can use an unix socket instead +of an inet socket: + +

qemu linux.img -hdb nbd:unix:/tmp/my_socket
+
+

In this case, the block device must be exported using qemu-nbd: + +

qemu-nbd --socket=/tmp/my_socket my_disk.qcow2
+
+

The use of qemu-nbd allows to share a disk between several guests: +

qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2
+
+

and then you can use it with two guests: +

qemu linux1.img -hdb nbd:unix:/tmp/my_socket
+qemu linux2.img -hdb nbd:unix:/tmp/my_socket
+
+

+ + +

3.7 Network emulation

+ +

QEMU can simulate several network cards (PCI or ISA cards on the PC +target) and can connect them to an arbitrary number of Virtual Local +Area Networks (VLANs). Host TAP devices can be connected to any QEMU +VLAN. VLAN can be connected between separate instances of QEMU to +simulate large networks. For simpler usage, a non privileged user mode +network stack can replace the TAP device to have a basic network +connection. + +

3.7.1 VLANs

+ +

QEMU simulates several VLANs. A VLAN can be symbolised as a virtual +connection between several network devices. These devices can be for +example QEMU virtual Ethernet cards or virtual Host ethernet devices +(TAP devices). + +

3.7.2 Using TAP network interfaces

+ +

This is the standard way to connect QEMU to a real network. QEMU adds +a virtual network device on your host (called tapN), and you +can then configure it as if it was a real ethernet card. + +

3.7.2.1 Linux host
+ +

As an example, you can download the linux-test-xxx.tar.gz +archive and copy the script qemu-ifup in /etc and +configure properly sudo so that the command ifconfig +contained in qemu-ifup can be executed as root. You must verify +that your host kernel supports the TAP network interfaces: the +device /dev/net/tun must be present. + +

See sec_invocation to have examples of command lines using the +TAP network interfaces. + +

3.7.2.2 Windows host
+ +

There is a virtual ethernet driver for Windows 2000/XP systems, called +TAP-Win32. But it is not included in standard QEMU for Windows, +so you will need to get it separately. It is part of OpenVPN package, +so download OpenVPN from : http://openvpn.net/. + +

3.7.3 Using the user mode network stack

+ +

By using the option -net user (default configuration if no +-net option is specified), QEMU uses a completely user mode +network stack (you don't need root privilege to use the virtual +network). The virtual network configuration is the following: + +

+         QEMU VLAN      <------>  Firewall/DHCP server <-----> Internet
+                           |          (10.0.2.2)
+                           |
+                           ---->  DNS server (10.0.2.3)
+                           |
+                           ---->  SMB server (10.0.2.4)
+
+

The QEMU VM behaves as if it was behind a firewall which blocks all +incoming connections. You can use a DHCP client to automatically +configure the network in the QEMU VM. The DHCP server assign addresses +to the hosts starting from 10.0.2.15. + +

In order to check that the user mode network is working, you can ping +the address 10.0.2.2 and verify that you got an address in the range +10.0.2.x from the QEMU virtual DHCP server. + +

Note that ping is not supported reliably to the internet as it +would require root privileges. It means you can only ping the local +router (10.0.2.2). + +

When using the built-in TFTP server, the router is also the TFTP +server. + +

When using the -redir option, TCP or UDP connections can be +redirected from the host to the guest. It allows for example to +redirect X11, telnet or SSH connections. + +

3.7.4 Connecting VLANs between QEMU instances

+ +

Using the -net socket option, it is possible to make VLANs +that span several QEMU instances. See sec_invocation to have a +basic example. + +

3.8 Other Devices

+ +

3.8.1 Inter-VM Shared Memory device

+ +

With KVM enabled on a Linux host, a shared memory device is available. Guests +map a POSIX shared memory region into the guest as a PCI device that enables +zero-copy communication to the application level of the guests. The basic +syntax is: + +

qemu -device ivshmem,size=<size in format accepted by -m>[,shm=<shm name>]
+
+

If desired, interrupts can be sent between guest VMs accessing the same shared +memory region. Interrupt support requires using a shared memory server and +using a chardev socket to connect to it. The code for the shared memory server +is qemu.git/contrib/ivshmem-server. An example syntax when using the shared +memory server is: + +

qemu -device ivshmem,size=<size in format accepted by -m>[,chardev=<id>]
+                        [,msi=on][,ioeventfd=on][,vectors=n][,role=peer|master]
+qemu -chardev socket,path=<path>,id=<id>
+
+

When using the server, the guest will be assigned a VM ID (>=0) that allows guests +using the same server to communicate via interrupts. Guests can read their +VM ID from a device register (see example code). Since receiving the shared +memory region from the server is asynchronous, there is a (small) chance the +guest may boot before the shared memory is attached. To allow an application +to ensure shared memory is attached, the VM ID register will return -1 (an +invalid VM ID) until the memory is attached. Once the shared memory is +attached, the VM ID will return the guest's valid VM ID. With these semantics, +the guest application can check to ensure the shared memory is attached to the +guest before proceeding. + +

The role argument can be set to either master or peer and will affect +how the shared memory is migrated. With role=master, the guest will +copy the shared memory on migration to the destination host. With +role=peer, the guest will not be able to migrate with the device attached. +With the peer case, the device should be detached and then reattached +after migration using the PCI hotplug support. + +

+ + +

3.9 Direct Linux Boot

+ +

This section explains how to launch a Linux kernel inside QEMU without +having to make a full bootable image. It is very useful for fast Linux +kernel testing. + +

The syntax is: +

qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda"
+
+

Use -kernel to provide the Linux kernel image and +-append to give the kernel command line arguments. The +-initrd option can be used to provide an INITRD image. + +

When using the direct Linux boot, a disk image for the first hard disk +hda is required because its boot sector is used to launch the +Linux kernel. + +

If you do not need graphical output, you can disable it and redirect +the virtual serial port and the QEMU monitor to the console with the +-nographic option. The typical command line is: +

qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
+     -append "root=/dev/hda console=ttyS0" -nographic
+
+

Use <Ctrl-a c> to switch between the serial console and the +monitor (see pcsys_keys). + +

+ + +

3.10 USB emulation

+ +

QEMU emulates a PCI UHCI USB controller. You can virtually plug +virtual USB devices or real host USB devices (experimental, works only +on Linux hosts). Qemu will automatically create and connect virtual USB hubs +as necessary to connect multiple USB devices. + +

+ + +

3.10.1 Connecting USB devices

+ +

USB devices can be connected with the -usbdevice commandline option +or the usb_add monitor command. Available devices are: + +

+
mouse
Virtual Mouse. This will override the PS/2 mouse emulation when activated. +
tablet
Pointer device that uses absolute coordinates (like a touchscreen). +This means qemu is able to report the mouse position without having +to grab the mouse. Also overrides the PS/2 mouse emulation when activated. +
disk:file
Mass storage device based on file (see disk_images) +
host:bus.addr
Pass through the host device identified by bus.addr +(Linux only) +
host:vendor_id:product_id
Pass through the host device identified by vendor_id:product_id +(Linux only) +
wacom-tablet
Virtual Wacom PenPartner tablet. This device is similar to the tablet +above but it can be used with the tslib library because in addition to touch +coordinates it reports touch pressure. +
keyboard
Standard USB keyboard. Will override the PS/2 keyboard (if present). +
serial:[vendorid=vendor_id][,product_id=product_id]:dev
Serial converter. This emulates an FTDI FT232BM chip connected to host character +device dev. The available character devices are the same as for the +-serial option. The vendorid and productid options can be +used to override the default 0403:6001. For instance, +
     usb_add serial:productid=FA00:tcp:192.168.0.2:4444
+
+

will connect to tcp port 4444 of ip 192.168.0.2, and plug that to the virtual +serial converter, faking a Matrix Orbital LCD Display (USB ID 0403:FA00). +

braille
Braille device. This will use BrlAPI to display the braille output on a real +or fake device. +
net:options
Network adapter that supports CDC ethernet and RNDIS protocols. options +specifies NIC options as with -net nic,options (see description). +For instance, user-mode networking can be used with +
     qemu [...OPTIONS...] -net user,vlan=0 -usbdevice net:vlan=0
+
+

Currently this cannot be used in machines that support PCI NICs. +

bt[:hci-type]
Bluetooth dongle whose type is specified in the same format as with +the -bt hci option, see allowed HCI types. If +no type is given, the HCI logic corresponds to -bt hci,vlan=0. +This USB device implements the USB Transport Layer of HCI. Example +usage: +
     qemu [...OPTIONS...] -usbdevice bt:hci,vlan=3 -bt device:keyboard,vlan=3
+
+
+ +

+ + +

3.10.2 Using host USB devices on a Linux host

+ +

WARNING: this is an experimental feature. QEMU will slow down when +using it. USB devices requiring real time streaming (i.e. USB Video +Cameras) are not supported yet. + +

    +
  1. If you use an early Linux 2.4 kernel, verify that no Linux driver +is actually using the USB device. A simple way to do that is simply to +disable the corresponding kernel module by renaming it from mydriver.o +to mydriver.o.disabled. + +
  2. Verify that /proc/bus/usb is working (most Linux distributions should enable it by default). You should see something like that: +
         ls /proc/bus/usb
    +     001  devices  drivers
    +
    +
  3. Since only root can access to the USB devices directly, you can either launch QEMU as root or change the permissions of the USB devices you want to use. For testing, the following suffices: +
         chown -R myuid /proc/bus/usb
    +
    +
  4. Launch QEMU and do in the monitor: +
         info usbhost
    +       Device 1.2, speed 480 Mb/s
    +         Class 00: USB device 1234:5678, USB DISK
    +
    +

    You should see the list of the devices you can use (Never try to use +hubs, it won't work). + +

  5. Add the device in QEMU by using: +
         usb_add host:1234:5678
    +
    +

    Normally the guest OS should report that a new USB device is +plugged. You can use the option -usbdevice to do the same. + +

  6. Now you can try to use the host USB device in QEMU. + +
+ +

When relaunching QEMU, you may have to unplug and plug again the USB +device to make it work again (this is a bug). + +

+ + +

3.11 VNC security

+ +

The VNC server capability provides access to the graphical console +of the guest VM across the network. This has a number of security +considerations depending on the deployment scenarios. + +

+ + +

3.11.1 Without passwords

+ +

The simplest VNC server setup does not include any form of authentication. +For this setup it is recommended to restrict it to listen on a UNIX domain +socket only. For example + +

qemu [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc
+
+

This ensures that only users on local box with read/write access to that +path can access the VNC server. To securely access the VNC server from a +remote machine, a combination of netcat+ssh can be used to provide a secure +tunnel. + +

+ + +

3.11.2 With passwords

+ +

The VNC protocol has limited support for password based authentication. Since +the protocol limits passwords to 8 characters it should not be considered +to provide high security. The password can be fairly easily brute-forced by +a client making repeat connections. For this reason, a VNC server using password +authentication should be restricted to only listen on the loopback interface +or UNIX domain sockets. Password authentication is requested with the password +option, and then once QEMU is running the password is set with the monitor. Until +the monitor is used to set the password all clients will be rejected. + +

qemu [...OPTIONS...] -vnc :1,password -monitor stdio
+(qemu) change vnc password
+Password: ********
+(qemu)
+
+

+ + +

3.11.3 With x509 certificates

+ +

The QEMU VNC server also implements the VeNCrypt extension allowing use of +TLS for encryption of the session, and x509 certificates for authentication. +The use of x509 certificates is strongly recommended, because TLS on its +own is susceptible to man-in-the-middle attacks. Basic x509 certificate +support provides a secure session, but no authentication. This allows any +client to connect, and provides an encrypted session. + +

qemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio
+
+

In the above example /etc/pki/qemu should contain at least three files, +ca-cert.pem, server-cert.pem and server-key.pem. Unprivileged +users will want to use a private directory, for example $HOME/.pki/qemu. +NB the server-key.pem file should be protected with file mode 0600 to +only be readable by the user owning it. + +

+ + +

3.11.4 With x509 certificates and client verification

+ +

Certificates can also provide a means to authenticate the client connecting. +The server will request that the client provide a certificate, which it will +then validate against the CA certificate. This is a good choice if deploying +in an environment with a private internal certificate authority. + +

qemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio
+
+

+ + +

3.11.5 With x509 certificates, client verification and passwords

+ +

Finally, the previous method can be combined with VNC password authentication +to provide two layers of authentication for clients. + +

qemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio
+(qemu) change vnc password
+Password: ********
+(qemu)
+
+

+ + +

3.11.6 With SASL authentication

+ +

The SASL authentication method is a VNC extension, that provides an +easily extendable, pluggable authentication method. This allows for +integration with a wide range of authentication mechanisms, such as +PAM, GSSAPI/Kerberos, LDAP, SQL databases, one-time keys and more. +The strength of the authentication depends on the exact mechanism +configured. If the chosen mechanism also provides a SSF layer, then +it will encrypt the datastream as well. + +

Refer to the later docs on how to choose the exact SASL mechanism +used for authentication, but assuming use of one supporting SSF, +then QEMU can be launched with: + +

qemu [...OPTIONS...] -vnc :1,sasl -monitor stdio
+
+

+ + +

3.11.7 With x509 certificates and SASL authentication

+ +

If the desired SASL authentication mechanism does not supported +SSF layers, then it is strongly advised to run it in combination +with TLS and x509 certificates. This provides securely encrypted +data stream, avoiding risk of compromising of the security +credentials. This can be enabled, by combining the 'sasl' option +with the aforementioned TLS + x509 options: + +

qemu [...OPTIONS...] -vnc :1,tls,x509,sasl -monitor stdio
+
+

+ + +

3.11.8 Generating certificates for VNC

+ +

The GNU TLS packages provides a command called certtool which can +be used to generate certificates and keys in PEM format. At a minimum it +is neccessary to setup a certificate authority, and issue certificates to +each server. If using certificates for authentication, then each client +will also need to be issued a certificate. The recommendation is for the +server to keep its certificates in either /etc/pki/qemu or for +unprivileged users in $HOME/.pki/qemu. + +

+ + +

3.11.8.1 Setup the Certificate Authority
+ +

This step only needs to be performed once per organization / organizational +unit. First the CA needs a private key. This key must be kept VERY secret +and secure. If this key is compromised the entire trust chain of the certificates +issued with it is lost. + +

# certtool --generate-privkey > ca-key.pem
+
+

A CA needs to have a public certificate. For simplicity it can be a self-signed +certificate, or one issue by a commercial certificate issuing authority. To +generate a self-signed certificate requires one core piece of information, the +name of the organization. + +

# cat > ca.info <<EOF
+cn = Name of your organization
+ca
+cert_signing_key
+EOF
+# certtool --generate-self-signed \
+           --load-privkey ca-key.pem
+           --template ca.info \
+           --outfile ca-cert.pem
+
+

The ca-cert.pem file should be copied to all servers and clients wishing to utilize +TLS support in the VNC server. The ca-key.pem must not be disclosed/copied at all. + +

+ + +

3.11.8.2 Issuing server certificates
+ +

Each server (or host) needs to be issued with a key and certificate. When connecting +the certificate is sent to the client which validates it against the CA certificate. +The core piece of information for a server certificate is the hostname. This should +be the fully qualified hostname that the client will connect with, since the client +will typically also verify the hostname in the certificate. On the host holding the +secure CA private key: + +

# cat > server.info <<EOF
+organization = Name  of your organization
+cn = server.foo.example.com
+tls_www_server
+encryption_key
+signing_key
+EOF
+# certtool --generate-privkey > server-key.pem
+# certtool --generate-certificate \
+           --load-ca-certificate ca-cert.pem \
+           --load-ca-privkey ca-key.pem \
+           --load-privkey server server-key.pem \
+           --template server.info \
+           --outfile server-cert.pem
+
+

The server-key.pem and server-cert.pem files should now be securely copied +to the server for which they were generated. The server-key.pem is security +sensitive and should be kept protected with file mode 0600 to prevent disclosure. + +

+ + +

3.11.8.3 Issuing client certificates
+ +

If the QEMU VNC server is to use the x509verify option to validate client +certificates as its authentication mechanism, each client also needs to be issued +a certificate. The client certificate contains enough metadata to uniquely identify +the client, typically organization, state, city, building, etc. On the host holding +the secure CA private key: + +

# cat > client.info <<EOF
+country = GB
+state = London
+locality = London
+organiazation = Name of your organization
+cn = client.foo.example.com
+tls_www_client
+encryption_key
+signing_key
+EOF
+# certtool --generate-privkey > client-key.pem
+# certtool --generate-certificate \
+           --load-ca-certificate ca-cert.pem \
+           --load-ca-privkey ca-key.pem \
+           --load-privkey client-key.pem \
+           --template client.info \
+           --outfile client-cert.pem
+
+

The client-key.pem and client-cert.pem files should now be securely +copied to the client for which they were generated. + +

+ + +

3.11.9 Configuring SASL mechanisms

+ +

The following documentation assumes use of the Cyrus SASL implementation on a +Linux host, but the principals should apply to any other SASL impl. When SASL +is enabled, the mechanism configuration will be loaded from system default +SASL service config /etc/sasl2/qemu.conf. If running QEMU as an +unprivileged user, an environment variable SASL_CONF_PATH can be used +to make it search alternate locations for the service config. + +

The default configuration might contain + +

mech_list: digest-md5
+sasldb_path: /etc/qemu/passwd.db
+
+

This says to use the 'Digest MD5' mechanism, which is similar to the HTTP +Digest-MD5 mechanism. The list of valid usernames & passwords is maintained +in the /etc/qemu/passwd.db file, and can be updated using the saslpasswd2 +command. While this mechanism is easy to configure and use, it is not +considered secure by modern standards, so only suitable for developers / +ad-hoc testing. + +

A more serious deployment might use Kerberos, which is done with the 'gssapi' +mechanism + +

mech_list: gssapi
+keytab: /etc/qemu/krb5.tab
+
+

For this to work the administrator of your KDC must generate a Kerberos +principal for the server, with a name of 'qemu/somehost.example.com@EXAMPLE.COM' +replacing 'somehost.example.com' with the fully qualified host name of the +machine running QEMU, and 'EXAMPLE.COM' with the Keberos Realm. + +

Other configurations will be left as an exercise for the reader. It should +be noted that only Digest-MD5 and GSSAPI provides a SSF layer for data +encryption. For all other mechanisms, VNC should always be configured to +use TLS and x509 certificates to protect security credentials from snooping. + +

+ + +

3.12 GDB usage

+ +

QEMU has a primitive support to work with gdb, so that you can do +'Ctrl-C' while the virtual machine is running and inspect its state. + +

In order to use gdb, launch qemu with the '-s' option. It will wait for a +gdb connection: +

> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \
+       -append "root=/dev/hda"
+Connected to host network interface: tun0
+Waiting gdb connection on port 1234
+
+

Then launch gdb on the 'vmlinux' executable: +

> gdb vmlinux
+
+

In gdb, connect to QEMU: +

(gdb) target remote localhost:1234
+
+

Then you can use gdb normally. For example, type 'c' to launch the kernel: +

(gdb) c
+
+

Here are some useful tips in order to use gdb on system code: + +

    +
  1. Use info reg to display all the CPU registers. +
  2. Use x/10i $eip to display the code at the PC position. +
  3. Use set architecture i8086 to dump 16 bit code. Then use +x/10i $cs*16+$eip to dump the code at the PC position. +
+ +

Advanced debugging options: + +

The default single stepping behavior is step with the IRQs and timer service routines off. It is set this way because when gdb executes a single step it expects to advance beyond the current instruction. With the IRQs and and timer service routines on, a single step might jump into the one of the interrupt or exception vectors instead of executing the current instruction. This means you may hit the same breakpoint a number of times before executing the instruction gdb wants to have executed. Because there are rare circumstances where you want to single step into an interrupt vector the behavior can be controlled from GDB. There are three commands you can query and set the single step behavior: +

+
maintenance packet qqemu.sstepbits
+This will display the MASK bits used to control the single stepping IE: +
     (gdb) maintenance packet qqemu.sstepbits
+     sending: "qqemu.sstepbits"
+     received: "ENABLE=1,NOIRQ=2,NOTIMER=4"
+
+
maintenance packet qqemu.sstep
+This will display the current value of the mask used when single stepping IE: +
     (gdb) maintenance packet qqemu.sstep
+     sending: "qqemu.sstep"
+     received: "0x7"
+
+
maintenance packet Qqemu.sstep=HEX_VALUE
+This will change the single step mask, so if wanted to enable IRQs on the single step, but not timers, you would use: +
     (gdb) maintenance packet Qqemu.sstep=0x5
+     sending: "qemu.sstep=0x5"
+     received: "OK"
+
+
+ +

+ + +

3.13 Target OS specific information

+ +

3.13.1 Linux

+ +

To have access to SVGA graphic modes under X11, use the vesa or +the cirrus X11 driver. For optimal performances, use 16 bit +color depth in the guest and the host OS. + +

When using a 2.6 guest Linux kernel, you should add the option +clock=pit on the kernel command line because the 2.6 Linux +kernels make very strict real time clock checks by default that QEMU +cannot simulate exactly. + +

When using a 2.6 guest Linux kernel, verify that the 4G/4G patch is +not activated because QEMU is slower with this patch. The QEMU +Accelerator Module is also much slower in this case. Earlier Fedora +Core 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporate this +patch by default. Newer kernels don't have it. + +

3.13.2 Windows

+ +

If you have a slow host, using Windows 95 is better as it gives the +best speed. Windows 2000 is also a good choice. + +

3.13.2.1 SVGA graphic modes support
+ +

QEMU emulates a Cirrus Logic GD5446 Video +card. All Windows versions starting from Windows 95 should recognize +and use this graphic card. For optimal performances, use 16 bit color +depth in the guest and the host OS. + +

If you are using Windows XP as guest OS and if you want to use high +resolution modes which the Cirrus Logic BIOS does not support (i.e. >= +1280x1024x16), then you should use the VESA VBE virtual graphic card +(option -std-vga). + +

3.13.2.2 CPU usage reduction
+ +

Windows 9x does not correctly use the CPU HLT +instruction. The result is that it takes host CPU cycles even when +idle. You can install the utility from +http://www.user.cityline.ru/~maxamn/amnhltm.zip to solve this +problem. Note that no such tool is needed for NT, 2000 or XP. + +

3.13.2.3 Windows 2000 disk full problem
+ +

Windows 2000 has a bug which gives a disk full problem during its +installation. When installing it, use the -win2k-hack QEMU +option to enable a specific workaround. After Windows 2000 is +installed, you no longer need this option (this option slows down the +IDE transfers). + +

3.13.2.4 Windows 2000 shutdown
+ +

Windows 2000 cannot automatically shutdown in QEMU although Windows 98 +can. It comes from the fact that Windows 2000 does not automatically +use the APM driver provided by the BIOS. + +

In order to correct that, do the following (thanks to Struan +Bartlett): go to the Control Panel => Add/Remove Hardware & Next => +Add/Troubleshoot a device => Add a new device & Next => No, select the +hardware from a list & Next => NT Apm/Legacy Support & Next => Next +(again) a few times. Now the driver is installed and Windows 2000 now +correctly instructs QEMU to shutdown at the appropriate moment. + +

3.13.2.5 Share a directory between Unix and Windows
+ +

See sec_invocation about the help of the option -smb. + +

3.13.2.6 Windows XP security problem
+ +

Some releases of Windows XP install correctly but give a security +error when booting: +

A problem is preventing Windows from accurately checking the
+license for this computer. Error code: 0x800703e6.
+
+

The workaround is to install a service pack for XP after a boot in safe +mode. Then reboot, and the problem should go away. Since there is no +network while in safe mode, its recommended to download the full +installation of SP1 or SP2 and transfer that via an ISO or using the +vvfat block device ("-hdb fat:directory_which_holds_the_SP"). + +

3.13.3 MS-DOS and FreeDOS

+ +
3.13.3.1 CPU usage reduction
+ +

DOS does not correctly use the CPU HLT instruction. The result is that +it takes host CPU cycles even when idle. You can install the utility +from http://www.vmware.com/software/dosidle210.zip to solve this +problem. + +

+ +

4 QEMU System emulator for non PC targets

+ +

QEMU is a generic emulator and it emulates many non PC +machines. Most of the options are similar to the PC emulator. The +differences are mentioned in the following sections. + +

+ +

4.1 PowerPC System emulator

+ +

+Use the executable qemu-system-ppc to simulate a complete PREP +or PowerMac PowerPC system. + +

QEMU emulates the following PowerMac peripherals: + +

    +
  • UniNorth or Grackle PCI Bridge +
  • PCI VGA compatible card with VESA Bochs Extensions +
  • 2 PMAC IDE interfaces with hard disk and CD-ROM support +
  • NE2000 PCI adapters +
  • Non Volatile RAM +
  • VIA-CUDA with ADB keyboard and mouse. +
+ +

QEMU emulates the following PREP peripherals: + +

    +
  • PCI Bridge +
  • PCI VGA compatible card with VESA Bochs Extensions +
  • 2 IDE interfaces with hard disk and CD-ROM support +
  • Floppy disk +
  • NE2000 network adapters +
  • Serial port +
  • PREP Non Volatile RAM +
  • PC compatible keyboard and mouse. +
+ +

QEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at +http://perso.magic.fr/l_indien/OpenHackWare/index.htm. + +

Since version 0.9.1, QEMU uses OpenBIOS http://www.openbios.org/ +for the g3beige and mac99 PowerMac machines. OpenBIOS is a free (GPL +v2) portable firmware implementation. The goal is to implement a 100% +IEEE 1275-1994 (referred to as Open Firmware) compliant firmware. + + +

The following options are specific to the PowerPC emulation: + +

+
-g WxH[xDEPTH]
+Set the initial VGA graphic mode. The default is 800x600x15. + +
-prom-env string
+Set OpenBIOS variables in NVRAM, for example: + +
     qemu-system-ppc -prom-env 'auto-boot?=false' \
+      -prom-env 'boot-device=hd:2,\yaboot' \
+      -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
+
+

These variables are not used by Open Hack'Ware. + +

+ + +

More information is available at +http://perso.magic.fr/l_indien/qemu-ppc/. + +

+ +

4.2 Sparc32 System emulator

+ +

+Use the executable qemu-system-sparc to simulate the following +Sun4m architecture machines: +

    +
  • SPARCstation 4 +
  • SPARCstation 5 +
  • SPARCstation 10 +
  • SPARCstation 20 +
  • SPARCserver 600MP +
  • SPARCstation LX +
  • SPARCstation Voyager +
  • SPARCclassic +
  • SPARCbook +
+ +

The emulation is somewhat complete. SMP up to 16 CPUs is supported, +but Linux limits the number of usable CPUs to 4. + +

It's also possible to simulate a SPARCstation 2 (sun4c architecture), +SPARCserver 1000, or SPARCcenter 2000 (sun4d architecture), but these +emulators are not usable yet. + +

QEMU emulates the following sun4m/sun4c/sun4d peripherals: + +

    +
  • IOMMU or IO-UNITs +
  • TCX Frame buffer +
  • Lance (Am7990) Ethernet +
  • Non Volatile RAM M48T02/M48T08 +
  • Slave I/O: timers, interrupt controllers, Zilog serial ports, keyboard +and power/reset logic +
  • ESP SCSI controller with hard disk and CD-ROM support +
  • Floppy drive (not on SS-600MP) +
  • CS4231 sound device (only on SS-5, not working yet) +
+ +

The number of peripherals is fixed in the architecture. Maximum +memory size depends on the machine type, for SS-5 it is 256MB and for +others 2047MB. + +

Since version 0.8.2, QEMU uses OpenBIOS +http://www.openbios.org/. OpenBIOS is a free (GPL v2) portable +firmware implementation. The goal is to implement a 100% IEEE +1275-1994 (referred to as Open Firmware) compliant firmware. + +

A sample Linux 2.6 series kernel and ram disk image are available on +the QEMU web site. There are still issues with NetBSD and OpenBSD, but +some kernel versions work. Please note that currently Solaris kernels +don't work probably due to interface issues between OpenBIOS and +Solaris. + + +

The following options are specific to the Sparc32 emulation: + +

+
-g WxHx[xDEPTH]
+Set the initial TCX graphic mode. The default is 1024x768x8, currently +the only other possible mode is 1024x768x24. + +
-prom-env string
+Set OpenBIOS variables in NVRAM, for example: + +
     qemu-system-sparc -prom-env 'auto-boot?=false' \
+      -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
+
+
-M [SS-4|SS-5|SS-10|SS-20|SS-600MP|LX|Voyager|SPARCClassic] [|SPARCbook|SS-2|SS-1000|SS-2000]
+Set the emulated machine type. Default is SS-5. + +
+ + +

+ +

4.3 Sparc64 System emulator

+ +

+Use the executable qemu-system-sparc64 to simulate a Sun4u +(UltraSPARC PC-like machine), Sun4v (T1 PC-like machine), or generic +Niagara (T1) machine. The emulator is not usable for anything yet, but +it can launch some kernels. + +

QEMU emulates the following peripherals: + +

    +
  • UltraSparc IIi APB PCI Bridge +
  • PCI VGA compatible card with VESA Bochs Extensions +
  • PS/2 mouse and keyboard +
  • Non Volatile RAM M48T59 +
  • PC-compatible serial ports +
  • 2 PCI IDE interfaces with hard disk and CD-ROM support +
  • Floppy disk +
+ + +

The following options are specific to the Sparc64 emulation: + +

+
-prom-env string
+Set OpenBIOS variables in NVRAM, for example: + +
     qemu-system-sparc64 -prom-env 'auto-boot?=false'
+
+
-M [sun4u|sun4v|Niagara]
+Set the emulated machine type. The default is sun4u. + +
+ + +

+ +

4.4 MIPS System emulator

+ +

+Four executables cover simulation of 32 and 64-bit MIPS systems in +both endian options, qemu-system-mips, qemu-system-mipsel +qemu-system-mips64 and qemu-system-mips64el. +Five different machine types are emulated: + +

    +
  • A generic ISA PC-like machine "mips" +
  • The MIPS Malta prototype board "malta" +
  • An ACER Pica "pica61". This machine needs the 64-bit emulator. +
  • MIPS emulator pseudo board "mipssim" +
  • A MIPS Magnum R4000 machine "magnum". This machine needs the 64-bit emulator. +
+ +

The generic emulation is supported by Debian 'Etch' and is able to +install Debian into a virtual disk image. The following devices are +emulated: + +

    +
  • A range of MIPS CPUs, default is the 24Kf +
  • PC style serial port +
  • PC style IDE disk +
  • NE2000 network card +
+ +

The Malta emulation supports the following devices: + +

    +
  • Core board with MIPS 24Kf CPU and Galileo system controller +
  • PIIX4 PCI/USB/SMbus controller +
  • The Multi-I/O chip's serial device +
  • PCI network cards (PCnet32 and others) +
  • Malta FPGA serial device +
  • Cirrus (default) or any other PCI VGA graphics card +
+ +

The ACER Pica emulation supports: + +

    +
  • MIPS R4000 CPU +
  • PC-style IRQ and DMA controllers +
  • PC Keyboard +
  • IDE controller +
+ +

The mipssim pseudo board emulation provides an environment similiar +to what the proprietary MIPS emulator uses for running Linux. +It supports: + +

    +
  • A range of MIPS CPUs, default is the 24Kf +
  • PC style serial port +
  • MIPSnet network emulation +
+ +

The MIPS Magnum R4000 emulation supports: + +

    +
  • MIPS R4000 CPU +
  • PC-style IRQ controller +
  • PC Keyboard +
  • SCSI controller +
  • G364 framebuffer +
+ +

+ +

4.5 ARM System emulator

+ +

+Use the executable qemu-system-arm to simulate a ARM +machine. The ARM Integrator/CP board is emulated with the following +devices: + +

    +
  • ARM926E, ARM1026E, ARM946E, ARM1136 or Cortex-A8 CPU +
  • Two PL011 UARTs +
  • SMC 91c111 Ethernet adapter +
  • PL110 LCD controller +
  • PL050 KMI with PS/2 keyboard and mouse. +
  • PL181 MultiMedia Card Interface with SD card. +
+ +

The ARM Versatile baseboard is emulated with the following devices: + +

    +
  • ARM926E, ARM1136 or Cortex-A8 CPU +
  • PL190 Vectored Interrupt Controller +
  • Four PL011 UARTs +
  • SMC 91c111 Ethernet adapter +
  • PL110 LCD controller +
  • PL050 KMI with PS/2 keyboard and mouse. +
  • PCI host bridge. Note the emulated PCI bridge only provides access to +PCI memory space. It does not provide access to PCI IO space. +This means some devices (eg. ne2k_pci NIC) are not usable, and others +(eg. rtl8139 NIC) are only usable when the guest drivers use the memory +mapped control registers. +
  • PCI OHCI USB controller. +
  • LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices. +
  • PL181 MultiMedia Card Interface with SD card. +
+ +

Several variants of the ARM RealView baseboard are emulated, +including the EB, PB-A8 and PBX-A9. Due to interactions with the +bootloader, only certain Linux kernel configurations work out +of the box on these boards. + +

Kernels for the PB-A8 board should have CONFIG_REALVIEW_HIGH_PHYS_OFFSET +enabled in the kernel, and expect 512M RAM. Kernels for The PBX-A9 board +should have CONFIG_SPARSEMEM enabled, CONFIG_REALVIEW_HIGH_PHYS_OFFSET +disabled and expect 1024M RAM. + +

The following devices are emuilated: + +

    +
  • ARM926E, ARM1136, ARM11MPCore, Cortex-A8 or Cortex-A9 MPCore CPU +
  • ARM AMBA Generic/Distributed Interrupt Controller +
  • Four PL011 UARTs +
  • SMC 91c111 or SMSC LAN9118 Ethernet adapter +
  • PL110 LCD controller +
  • PL050 KMI with PS/2 keyboard and mouse +
  • PCI host bridge +
  • PCI OHCI USB controller +
  • LSI53C895A PCI SCSI Host Bus Adapter with hard disk and CD-ROM devices +
  • PL181 MultiMedia Card Interface with SD card. +
+ +

The XScale-based clamshell PDA models ("Spitz", "Akita", "Borzoi" +and "Terrier") emulation includes the following peripherals: + +

    +
  • Intel PXA270 System-on-chip (ARM V5TE core) +
  • NAND Flash memory +
  • IBM/Hitachi DSCM microdrive in a PXA PCMCIA slot - not in "Akita" +
  • On-chip OHCI USB controller +
  • On-chip LCD controller +
  • On-chip Real Time Clock +
  • TI ADS7846 touchscreen controller on SSP bus +
  • Maxim MAX1111 analog-digital converter on I^2C bus +
  • GPIO-connected keyboard controller and LEDs +
  • Secure Digital card connected to PXA MMC/SD host +
  • Three on-chip UARTs +
  • WM8750 audio CODEC on I^2C and I^2S busses +
+ +

The Palm Tungsten|E PDA (codename "Cheetah") emulation includes the +following elements: + +

    +
  • Texas Instruments OMAP310 System-on-chip (ARM 925T core) +
  • ROM and RAM memories (ROM firmware image can be loaded with -option-rom) +
  • On-chip LCD controller +
  • On-chip Real Time Clock +
  • TI TSC2102i touchscreen controller / analog-digital converter / Audio +CODEC, connected through MicroWire and I^2S busses +
  • GPIO-connected matrix keypad +
  • Secure Digital card connected to OMAP MMC/SD host +
  • Three on-chip UARTs +
+ +

Nokia N800 and N810 internet tablets (known also as RX-34 and RX-44 / 48) +emulation supports the following elements: + +

    +
  • Texas Instruments OMAP2420 System-on-chip (ARM 1136 core) +
  • RAM and non-volatile OneNAND Flash memories +
  • Display connected to EPSON remote framebuffer chip and OMAP on-chip +display controller and a LS041y3 MIPI DBI-C controller +
  • TI TSC2301 (in N800) and TI TSC2005 (in N810) touchscreen controllers +driven through SPI bus +
  • National Semiconductor LM8323-controlled qwerty keyboard driven +through I^2C bus +
  • Secure Digital card connected to OMAP MMC/SD host +
  • Three OMAP on-chip UARTs and on-chip STI debugging console +
  • A Bluetooth(R) transciever and HCI connected to an UART +
  • Mentor Graphics "Inventra" dual-role USB controller embedded in a TI +TUSB6010 chip - only USB host mode is supported +
  • TI TMP105 temperature sensor driven through I^2C bus +
  • TI TWL92230C power management companion with an RTC on I^2C bus +
  • Nokia RETU and TAHVO multi-purpose chips with an RTC, connected +through CBUS +
+ +

The Luminary Micro Stellaris LM3S811EVB emulation includes the following +devices: + +

    +
  • Cortex-M3 CPU core. +
  • 64k Flash and 8k SRAM. +
  • Timers, UARTs, ADC and I^2C interface. +
  • OSRAM Pictiva 96x16 OLED with SSD0303 controller on I^2C bus. +
+ +

The Luminary Micro Stellaris LM3S6965EVB emulation includes the following +devices: + +

    +
  • Cortex-M3 CPU core. +
  • 256k Flash and 64k SRAM. +
  • Timers, UARTs, ADC, I^2C and SSI interfaces. +
  • OSRAM Pictiva 128x64 OLED with SSD0323 controller connected via SSI. +
+ +

The Freecom MusicPal internet radio emulation includes the following +elements: + +

    +
  • Marvell MV88W8618 ARM core. +
  • 32 MB RAM, 256 KB SRAM, 8 MB flash. +
  • Up to 2 16550 UARTs +
  • MV88W8xx8 Ethernet controller +
  • MV88W8618 audio controller, WM8750 CODEC and mixer +
  • 128×64 display with brightness control +
  • 2 buttons, 2 navigation wheels with button function +
+ +

The Siemens SX1 models v1 and v2 (default) basic emulation. +The emulaton includes the following elements: + +

    +
  • Texas Instruments OMAP310 System-on-chip (ARM 925T core) +
  • ROM and RAM memories (ROM firmware image can be loaded with -pflash) +V1 +1 Flash of 16MB and 1 Flash of 8MB +V2 +1 Flash of 32MB +
  • On-chip LCD controller +
  • On-chip Real Time Clock +
  • Secure Digital card connected to OMAP MMC/SD host +
  • Three on-chip UARTs +
+ +

The "Syborg" Symbian Virtual Platform base model includes the following +elements: + +

    +
  • ARM Cortex-A8 CPU +
  • Interrupt controller +
  • Timer +
  • Real Time Clock +
  • Keyboard +
  • Framebuffer +
  • Touchscreen +
  • UARTs +
+ +

A Linux 2.6 test image is available on the QEMU web site. More +information is available in the QEMU mailing-list archive. + + +

The following options are specific to the ARM emulation: + +

+
-semihosting
Enable semihosting syscall emulation. + +

On ARM this implements the "Angel" interface. + +

Note that this allows guest direct access to the host filesystem, +so should only be used with trusted guest OS. + +

+ +

+ +

4.6 ColdFire System emulator

+ +

+Use the executable qemu-system-m68k to simulate a ColdFire machine. +The emulator is able to boot a uClinux kernel. + +

The M5208EVB emulation includes the following devices: + +

    +
  • MCF5208 ColdFire V2 Microprocessor (ISA A+ with EMAC). +
  • Three Two on-chip UARTs. +
  • Fast Ethernet Controller (FEC) +
+ +

The AN5206 emulation includes the following devices: + +

    +
  • MCF5206 ColdFire V2 Microprocessor. +
  • Two on-chip UARTs. +
+ + +

The following options are specific to the ColdFire emulation: + +

+
-semihosting
Enable semihosting syscall emulation. + +

On M68K this implements the "ColdFire GDB" interface used by libgloss. + +

Note that this allows guest direct access to the host filesystem, +so should only be used with trusted guest OS. + +

+ +

+ +

4.7 Cris System emulator

+ +

+TODO + +

+ +

4.8 Microblaze System emulator

+ +

+TODO + +

+ +

4.9 SH4 System emulator

+ +

+TODO + +

+ +

5 QEMU User space emulator

+ +

+ +

5.1 Supported Operating Systems

+ +

The following OS are supported in user space emulation: + +

    +
  • Linux (referred as qemu-linux-user) +
  • Mac OS X/Darwin (referred as qemu-darwin-user) +
  • BSD (referred as qemu-bsd-user) +
+ +

+ +

5.2 Linux User space emulator

+ +

+ +

5.2.1 Quick Start

+ +

In order to launch a Linux process, QEMU needs the process executable +itself and all the target (x86) dynamic libraries used by it. + +

    +
  • On x86, you can just try to launch any process by using the native +libraries: + +
         qemu-i386 -L / /bin/ls
    +
    +

    -L / tells that the x86 dynamic linker must be searched with a +/ prefix. + +

  • Since QEMU is also a linux process, you can launch qemu with +qemu (NOTE: you can only do that if you compiled QEMU from the sources): + +
         qemu-i386 -L / qemu-i386 -L / /bin/ls
    +
    +
  • On non x86 CPUs, you need first to download at least an x86 glibc +(qemu-runtime-i386-XXX-.tar.gz on the QEMU web page). Ensure that +LD_LIBRARY_PATH is not set: + +
         unset LD_LIBRARY_PATH
    +
    +

    Then you can launch the precompiled ls x86 executable: + +

         qemu-i386 tests/i386/ls
    +
    +

    You can look at qemu-binfmt-conf.sh so that +QEMU is automatically launched by the Linux kernel when you try to +launch x86 executables. It requires the binfmt_misc module in the +Linux kernel. + +

  • The x86 version of QEMU is also included. You can try weird things such as: +
         qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 \
    +               /usr/local/qemu-i386/bin/ls-i386
    +
    +
+ +

+ +

5.2.2 Wine launch

+ +
    +
  • Ensure that you have a working QEMU with the x86 glibc +distribution (see previous section). In order to verify it, you must be +able to do: + +
         qemu-i386 /usr/local/qemu-i386/bin/ls-i386
    +
    +
  • Download the binary x86 Wine install +(qemu-XXX-i386-wine.tar.gz on the QEMU web page). + +
  • Configure Wine on your account. Look at the provided script +/usr/local/qemu-i386/bin/wine-conf.sh. Your previous +${HOME}/.wine directory is saved to ${HOME}/.wine.org. + +
  • Then you can try the example putty.exe: + +
         qemu-i386 /usr/local/qemu-i386/wine/bin/wine \
    +               /usr/local/qemu-i386/wine/c/Program\ Files/putty.exe
    +
    +
+ +

+ +

5.2.3 Command line options

+ +
usage: qemu-i386 [-h] [-d] [-L path] [-s size] [-cpu model] [-g port] [-B offset] [-R size] program [arguments...]
+
+
+
-h
Print the help +
-L path
Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386) +
-s size
Set the x86 stack size in bytes (default=524288) +
-cpu model
Select CPU model (-cpu ? for list and additional feature selection) +
-B offset
Offset guest address by the specified number of bytes. This is useful when +the address region required by guest applications is reserved on the host. +This option is currently only supported on some hosts. +
-R size
Pre-allocate a guest virtual address space of the given size (in bytes). +"G", "M", and "k" suffixes may be used when specifying the size. +
+ +

Debug options: + +

+
-d
Activate log (logfile=/tmp/qemu.log) +
-p pagesize
Act as if the host page size was 'pagesize' bytes +
-g port
Wait gdb connection to port +
-singlestep
Run the emulation in single step mode. +
+ +

Environment variables: + +

+
QEMU_STRACE
Print system calls and arguments similar to the 'strace' program +(NOTE: the actual 'strace' program will not work because the user +space emulator hasn't implemented ptrace). At the moment this is +incomplete. All system calls that don't have a specific argument +format are printed with information for six arguments. Many +flag-style arguments don't have decoders and will show up as numbers. +
+ +

+ +

5.2.4 Other binaries

+ +

qemu-alpha TODO. + +

qemu-armeb TODO. + +

qemu-arm is also capable of running ARM "Angel" semihosted ELF +binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB +configurations), and arm-uclinux bFLT format binaries. + +

qemu-m68k is capable of running semihosted binaries using the BDM +(m5xxx-ram-hosted.ld) or m68k-sim (sim.ld) syscall interfaces, and +coldfire uClinux bFLT format binaries. + +

The binary format is detected automatically. + +

qemu-cris TODO. + +

qemu-i386 TODO. +qemu-x86_64 TODO. + +

qemu-microblaze TODO. + +

qemu-mips TODO. +qemu-mipsel TODO. + +

qemu-ppc64abi32 TODO. +qemu-ppc64 TODO. +qemu-ppc TODO. + +

qemu-sh4eb TODO. +qemu-sh4 TODO. + +

qemu-sparc can execute Sparc32 binaries (Sparc32 CPU, 32 bit ABI). + +

qemu-sparc32plus can execute Sparc32 and SPARC32PLUS binaries +(Sparc64 CPU, 32 bit ABI). + +

qemu-sparc64 can execute some Sparc64 (Sparc64 CPU, 64 bit ABI) and +SPARC32PLUS binaries (Sparc64 CPU, 32 bit ABI). + +

+ + +

5.3 Mac OS X/Darwin User space emulator

+ +

+ + +

5.3.1 Mac OS X/Darwin Status

+ +
    +
  • target x86 on x86: Most apps (Cocoa and Carbon too) works. [1] +
  • target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!) +
  • target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1] +
  • target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet supported. +
+ +

[1] If you're host commpage can be executed by qemu. + +

+ + +

5.3.2 Quick Start

+ +

In order to launch a Mac OS X/Darwin process, QEMU needs the process executable +itself and all the target dynamic libraries used by it. If you don't have the FAT +libraries (you're running Mac OS X/ppc) you'll need to obtain it from a Mac OS X +CD or compile them by hand. + +

    +
  • On x86, you can just try to launch any process by using the native +libraries: + +
         qemu-i386 /bin/ls
    +
    +

    or to run the ppc version of the executable: + +

         qemu-ppc /bin/ls
    +
    +
  • On ppc, you'll have to tell qemu where your x86 libraries (and dynamic linker) +are installed: + +
         qemu-i386 -L /opt/x86_root/ /bin/ls
    +
    +

    -L /opt/x86_root/ tells that the dynamic linker (dyld) path is in +/opt/x86_root/usr/bin/dyld. + +

+ +

+ + +

5.3.3 Command line options

+ +
usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
+
+
+
-h
Print the help +
-L path
Set the library root path (default=/) +
-s size
Set the stack size in bytes (default=524288) +
+ +

Debug options: + +

+
-d
Activate log (logfile=/tmp/qemu.log) +
-p pagesize
Act as if the host page size was 'pagesize' bytes +
-singlestep
Run the emulation in single step mode. +
+ +

+ +

5.4 BSD User space emulator

+ +

+ +

5.4.1 BSD Status

+ +
    +
  • target Sparc64 on Sparc64: Some trivial programs work. +
+ +

+ +

5.4.2 Quick Start

+ +

In order to launch a BSD process, QEMU needs the process executable +itself and all the target dynamic libraries used by it. + +

    +
  • On Sparc64, you can just try to launch any process by using the native +libraries: + +
         qemu-sparc64 /bin/ls
    +
    +
+ +

+ +

5.4.3 Command line options

+ +
usage: qemu-sparc64 [-h] [-d] [-L path] [-s size] [-bsd type] program [arguments...]
+
+
+
-h
Print the help +
-L path
Set the library root path (default=/) +
-s size
Set the stack size in bytes (default=524288) +
-bsd type
Set the type of the emulated BSD Operating system. Valid values are +FreeBSD, NetBSD and OpenBSD (default). +
+ +

Debug options: + +

+
-d
Activate log (logfile=/tmp/qemu.log) +
-p pagesize
Act as if the host page size was 'pagesize' bytes +
-singlestep
Run the emulation in single step mode. +
+ +

+ +

6 Compilation from the sources

+ +

+ + +

6.1 Linux/Unix

+ +

6.1.1 Compilation

+ +

First you must decompress the sources: +

cd /tmp
+tar zxvf qemu-x.y.z.tar.gz
+cd qemu-x.y.z
+
+

Then you configure QEMU and build it (usually no options are needed): +

./configure
+make
+
+

Then type as root user: +

make install
+
+

to install QEMU in /usr/local. + +

+ +

6.2 Windows

+ +
    +
  • Install the current versions of MSYS and MinGW from +http://www.mingw.org/. You can find detailed installation +instructions in the download section and the FAQ. + +
  • Download +the MinGW development library of SDL 1.2.x +(SDL-devel-1.2.x-mingw32.tar.gz) from +http://www.libsdl.org. Unpack it in a temporary place and +edit the sdl-config script so that it gives the +correct SDL directory when invoked. + +
  • Install the MinGW version of zlib and make sure +zlib.h and libz.dll.a are in +MingGW's default header and linker search paths. + +
  • Extract the current version of QEMU. + +
  • Start the MSYS shell (file msys.bat). + +
  • Change to the QEMU directory. Launch ./configure and +make. If you have problems using SDL, verify that +sdl-config can be launched from the MSYS command line. + +
  • You can install QEMU in Program Files/Qemu by typing +make install. Don't forget to copy SDL.dll in +Program Files/Qemu. + +
+ +

+ +

6.3 Cross compilation for Windows with Linux

+ +
    +
  • Install the MinGW cross compilation tools available at +http://www.mingw.org/. + +
  • Download +the MinGW development library of SDL 1.2.x +(SDL-devel-1.2.x-mingw32.tar.gz) from +http://www.libsdl.org. Unpack it in a temporary place and +edit the sdl-config script so that it gives the +correct SDL directory when invoked. Set up the PATH environment +variable so that sdl-config can be launched by +the QEMU configuration script. + +
  • Install the MinGW version of zlib and make sure +zlib.h and libz.dll.a are in +MingGW's default header and linker search paths. + +
  • Configure QEMU for Windows cross compilation: +
         PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin:$PATH ./configure --cross-prefix='i686-pc-mingw32-'
    +
    +

    The example assumes sdl-config is installed under /usr/i686-pc-mingw32/sys-root/mingw/bin and +MinGW cross compilation tools have names like i686-pc-mingw32-gcc and i686-pc-mingw32-strip. +We set the PATH environment variable to ensure the MingW version of sdl-config is used and +use –cross-prefix to specify the name of the cross compiler. +You can also use –prefix to set the Win32 install path which defaults to c:/Program Files/Qemu. + +

    Under Fedora Linux, you can run: +

         yum -y install mingw32-gcc mingw32-SDL mingw32-zlib
    +
    +

    to get a suitable cross compilation environment. + +

  • You can install QEMU in the installation directory by typing +make install. Don't forget to copy SDL.dll and zlib1.dll into the +installation directory. + +
+ +

Wine can be used to launch the resulting qemu.exe compiled for Win32. + +

+ +

6.4 Mac OS X

+ +

The Mac OS X patches are not fully merged in QEMU, so you should look +at the QEMU mailing list archive to have all the necessary +information. + +

+ +

6.5 Make targets

+ +
+
make
make all
Make everything which is typically needed. + +
install
TODO + +
install-doc
TODO + +
make clean
Remove most files which were built during make. + +
make distclean
Remove everything which was built during make. + +
make dvi
make html
make info
make pdf
Create documentation in dvi, html, info or pdf format. + +
make cscope
TODO + +
make defconfig
(Re-)create some build configuration files. +User made changes will be overwritten. + +
tar
tarbin
TODO + +
+ +

+ +

Appendix A License

+ +

QEMU is a trademark of Fabrice Bellard. + +

QEMU is released under the GNU General Public License (TODO: add link). +Parts of QEMU have specific licenses, see file LICENSE. + +

TODO (refer to file LICENSE, include it, include the GPL?) + +

+ +

Appendix B Index

+ +

+ +

B.1 Concept Index

+ +

This is the main index. Should we combine all keywords in one index? TODO + +

+ +

B.2 Function Index

+ +

This index could be used for command line options and monitor functions. + + + +

+ +

B.3 Keystroke Index

+ +

This is a list of all keystrokes which have a special function +in system emulation. + + + +

+ +

B.4 Program Index

+ + + +
    +

+ +

B.5 Data Type Index

+ +

This index could be used for qdev device names and options. + + + +

    +

+ +

B.6 Variable Index

+ + + +
    +
+ + diff -Naur qemu-kvm-0.13.0/qemu-img-cmds.texi qemu-0.13.0-patched/qemu-img-cmds.texi --- qemu-kvm-0.13.0/qemu-img-cmds.texi 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-img-cmds.texi 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,10 @@ +@table @option +@item check [-f @var{fmt}] @var{filename} +@item create [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}] +@item commit [-f @var{fmt}] @var{filename} +@item convert [-c] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] @var{filename} [@var{filename2} [...]] @var{output_filename} +@item info [-f @var{fmt}] @var{filename} +@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot}] @var{filename} +@item rebase [-f @var{fmt}] [-u] -b @var{backing_file} [-F @var{backing_fmt}] @var{filename} +@item resize @var{filename} [+ | -]@var{size} +@end table diff -Naur qemu-kvm-0.13.0/qemu-img.1 qemu-0.13.0-patched/qemu-img.1 --- qemu-kvm-0.13.0/qemu-img.1 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-img.1 2011-06-19 16:52:33.000000000 -0400 @@ -0,0 +1,375 @@ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "QEMU-IMG 1" +.TH QEMU-IMG 1 "2011-06-19" " " " " +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +qemu\-img \- QEMU disk image utility +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +usage: qemu-img command [command options] +.SH "OPTIONS" +.IX Header "OPTIONS" +The following commands are supported: +.IP "\fBcheck [\-f\fR \fIfmt\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "check [-f fmt] filename" +.PD 0 +.IP "\fBcreate [\-f\fR \fIfmt\fR\fB] [\-o\fR \fIoptions\fR\fB]\fR \fIfilename\fR \fB[\fR\fIsize\fR\fB]\fR" 4 +.IX Item "create [-f fmt] [-o options] filename [size]" +.IP "\fBcommit [\-f\fR \fIfmt\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "commit [-f fmt] filename" +.IP "\fBconvert [\-c] [\-f\fR \fIfmt\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [\-o\fR \fIoptions\fR\fB]\fR \fIfilename\fR \fB[\fR\fIfilename2\fR \fB[...]]\fR \fIoutput_filename\fR" 4 +.IX Item "convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename" +.IP "\fBinfo [\-f\fR \fIfmt\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "info [-f fmt] filename" +.IP "\fBsnapshot [\-l | \-a\fR \fIsnapshot\fR \fB| \-c\fR \fIsnapshot\fR \fB| \-d\fR \fIsnapshot\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "snapshot [-l | -a snapshot | -c snapshot | -d snapshot] filename" +.IP "\fBrebase [\-f\fR \fIfmt\fR\fB] [\-u] \-b\fR \fIbacking_file\fR \fB[\-F\fR \fIbacking_fmt\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "rebase [-f fmt] [-u] -b backing_file [-F backing_fmt] filename" +.IP "\fBresize\fR \fIfilename\fR \fB[+ | \-]\fR\fIsize\fR" 4 +.IX Item "resize filename [+ | -]size" +.PD +.PP +Command parameters: +.IP "\fIfilename\fR" 4 +.IX Item "filename" +.Vb 1 +\& is a disk image filename +.Ve +.IP "\fIfmt\fR" 4 +.IX Item "fmt" +is the disk image format. It is guessed automatically in most cases. See below +for a description of the supported disk formats. +.IP "\fIsize\fR" 4 +.IX Item "size" +is the disk image size in bytes. Optional suffixes \f(CW\*(C`k\*(C'\fR or \f(CW\*(C`K\*(C'\fR +(kilobyte, 1024) \f(CW\*(C`M\*(C'\fR (megabyte, 1024k) and \f(CW\*(C`G\*(C'\fR (gigabyte, 1024M) +and T (terabyte, 1024G) are supported. \f(CW\*(C`b\*(C'\fR is ignored. +.IP "\fIoutput_filename\fR" 4 +.IX Item "output_filename" +is the destination disk image filename +.IP "\fIoutput_fmt\fR" 4 +.IX Item "output_fmt" +.Vb 1 +\& is the destination format +.Ve +.IP "\fIoptions\fR" 4 +.IX Item "options" +is a comma separated list of format specific options in a +name=value format. Use \f(CW\*(C`\-o ?\*(C'\fR for an overview of the options supported +by the used format or see the format descriptions below for details. +.IP "\fI\-c\fR" 4 +.IX Item "-c" +indicates that target image must be compressed (qcow format only) +.IP "\fI\-h\fR" 4 +.IX Item "-h" +with or without a command shows help and lists the supported formats +.PP +Parameters to snapshot subcommand: +.IP "\fBsnapshot\fR" 4 +.IX Item "snapshot" +is the name of the snapshot to create, apply or delete +.IP "\fB\-a\fR" 4 +.IX Item "-a" +applies a snapshot (revert disk to saved state) +.IP "\fB\-c\fR" 4 +.IX Item "-c" +creates a snapshot +.IP "\fB\-d\fR" 4 +.IX Item "-d" +deletes a snapshot +.IP "\fB\-l\fR" 4 +.IX Item "-l" +lists all snapshots in the given image +.PP +Command description: +.IP "\fBcreate [\-f\fR \fIfmt\fR\fB] [\-o\fR \fIoptions\fR\fB]\fR \fIfilename\fR \fB[\fR\fIsize\fR\fB]\fR" 4 +.IX Item "create [-f fmt] [-o options] filename [size]" +Create the new disk image \fIfilename\fR of size \fIsize\fR and format +\&\fIfmt\fR. Depending on the file format, you can add one or more \fIoptions\fR +that enable additional features of this format. +.Sp +If the option \fIbacking_file\fR is specified, then the image will record +only the differences from \fIbacking_file\fR. No size needs to be specified in +this case. \fIbacking_file\fR will never be modified unless you use the +\&\f(CW\*(C`commit\*(C'\fR monitor command (or qemu-img commit). +.Sp +The size can also be specified using the \fIsize\fR option with \f(CW\*(C`\-o\*(C'\fR, +it doesn't need to be specified separately in this case. +.IP "\fBcommit [\-f\fR \fIfmt\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "commit [-f fmt] filename" +Commit the changes recorded in \fIfilename\fR in its base image. +.IP "\fBconvert [\-c] [\-f\fR \fIfmt\fR\fB] [\-O\fR \fIoutput_fmt\fR\fB] [\-o\fR \fIoptions\fR\fB]\fR \fIfilename\fR \fB[\fR\fIfilename2\fR \fB[...]]\fR \fIoutput_filename\fR" 4 +.IX Item "convert [-c] [-f fmt] [-O output_fmt] [-o options] filename [filename2 [...]] output_filename" +Convert the disk image \fIfilename\fR to disk image \fIoutput_filename\fR +using format \fIoutput_fmt\fR. It can be optionally compressed (\f(CW\*(C`\-c\*(C'\fR +option) or use any format specific options like encryption (\f(CW\*(C`\-o\*(C'\fR option). +.Sp +Only the formats \f(CW\*(C`qcow\*(C'\fR and \f(CW\*(C`qcow2\*(C'\fR support compression. The +compression is read-only. It means that if a compressed sector is +rewritten, then it is rewritten as uncompressed data. +.Sp +Image conversion is also useful to get smaller image when using a +growable format such as \f(CW\*(C`qcow\*(C'\fR or \f(CW\*(C`cow\*(C'\fR: the empty sectors +are detected and suppressed from the destination image. +.Sp +You can use the \fIbacking_file\fR option to force the output image to be +created as a copy on write image of the specified base image; the +\&\fIbacking_file\fR should have the same content as the input's base image, +however the path, image format, etc may differ. +.IP "\fBinfo [\-f\fR \fIfmt\fR\fB]\fR \fIfilename\fR" 4 +.IX Item "info [-f fmt] filename" +Give information about the disk image \fIfilename\fR. Use it in +particular to know the size reserved on disk which can be different +from the displayed size. If \s-1VM\s0 snapshots are stored in the disk image, +they are displayed too. +.IP "\fBsnapshot [\-l | \-a\fR \fIsnapshot\fR \fB| \-c\fR \fIsnapshot\fR \fB| \-d\fR \fIsnapshot\fR \fB]\fR \fIfilename\fR" 4 +.IX Item "snapshot [-l | -a snapshot | -c snapshot | -d snapshot ] filename" +List, apply, create or delete snapshots in image \fIfilename\fR. +.IP "\fBresize\fR \fIfilename\fR \fB[+ | \-]\fR\fIsize\fR" 4 +.IX Item "resize filename [+ | -]size" +Change the disk image as if it had been created with \fIsize\fR. +.Sp +Before using this command to shrink a disk image, you \s-1MUST\s0 use file system and +partitioning tools inside the \s-1VM\s0 to reduce allocated file systems and partition +sizes accordingly. Failure to do so will result in data loss! +.Sp +After using this command to grow a disk image, you must use file system and +partitioning tools inside the \s-1VM\s0 to actually begin using the new space on the +device. +.PP +Supported image file formats: +.IP "\fBraw\fR" 4 +.IX Item "raw" +Raw disk image format (default). This format has the advantage of +being simple and easily exportable to all other emulators. If your +file system supports \fIholes\fR (for example in ext2 or ext3 on +Linux or \s-1NTFS\s0 on Windows), then only the written sectors will reserve +space. Use \f(CW\*(C`qemu\-img info\*(C'\fR to know the real size used by the +image or \f(CW\*(C`ls \-ls\*(C'\fR on Unix/Linux. +.IP "\fBhost_device\fR" 4 +.IX Item "host_device" +Host device format. This format should be used instead of raw when +converting to block devices or other devices where \*(L"holes\*(R" are not +supported. +.IP "\fBqcow2\fR" 4 +.IX Item "qcow2" +\&\s-1QEMU\s0 image format, the most versatile format. Use it to have smaller +images (useful if your filesystem does not supports holes, for example +on Windows), optional \s-1AES\s0 encryption, zlib based compression and +support of multiple \s-1VM\s0 snapshots. +.Sp +Supported options: +.RS 4 +.ie n .IP """backing_file""" 4 +.el .IP "\f(CWbacking_file\fR" 4 +.IX Item "backing_file" +File name of a base image (see \fBcreate\fR subcommand) +.ie n .IP """backing_fmt""" 4 +.el .IP "\f(CWbacking_fmt\fR" 4 +.IX Item "backing_fmt" +Image format of the base image +.ie n .IP """encryption""" 4 +.el .IP "\f(CWencryption\fR" 4 +.IX Item "encryption" +If this option is set to \f(CW\*(C`on\*(C'\fR, the image is encrypted. +.Sp +Encryption uses the \s-1AES\s0 format which is very secure (128 bit keys). Use +a long password (16 characters) to get maximum protection. +.ie n .IP """cluster_size""" 4 +.el .IP "\f(CWcluster_size\fR" 4 +.IX Item "cluster_size" +Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster +sizes can improve the image file size whereas larger cluster sizes generally +provide better performance. +.ie n .IP """preallocation""" 4 +.el .IP "\f(CWpreallocation\fR" 4 +.IX Item "preallocation" +Preallocation mode (allowed values: off, metadata). An image with preallocated +metadata is initially larger but can improve performance when the image needs +to grow. +.RE +.RS 4 +.RE +.IP "\fBqcow\fR" 4 +.IX Item "qcow" +Old \s-1QEMU\s0 image format. Left for compatibility. +.Sp +Supported options: +.RS 4 +.ie n .IP """backing_file""" 4 +.el .IP "\f(CWbacking_file\fR" 4 +.IX Item "backing_file" +File name of a base image (see \fBcreate\fR subcommand) +.ie n .IP """encryption""" 4 +.el .IP "\f(CWencryption\fR" 4 +.IX Item "encryption" +If this option is set to \f(CW\*(C`on\*(C'\fR, the image is encrypted. +.RE +.RS 4 +.RE +.IP "\fBcow\fR" 4 +.IX Item "cow" +User Mode Linux Copy On Write image format. Used to be the only growable +image format in \s-1QEMU\s0. It is supported only for compatibility with +previous versions. It does not work on win32. +.IP "\fBvdi\fR" 4 +.IX Item "vdi" +VirtualBox 1.1 compatible image format. +.IP "\fBvmdk\fR" 4 +.IX Item "vmdk" +VMware 3 and 4 compatible image format. +.Sp +Supported options: +.RS 4 +.ie n .IP """backing_fmt""" 4 +.el .IP "\f(CWbacking_fmt\fR" 4 +.IX Item "backing_fmt" +Image format of the base image +.ie n .IP """compat6""" 4 +.el .IP "\f(CWcompat6\fR" 4 +.IX Item "compat6" +Create a \s-1VMDK\s0 version 6 image (instead of version 4) +.RE +.RS 4 +.RE +.IP "\fBvpc\fR" 4 +.IX Item "vpc" +VirtualPC compatible image format (\s-1VHD\s0). +.IP "\fBcloop\fR" 4 +.IX Item "cloop" +Linux Compressed Loop image, useful only to reuse directly compressed +CD-ROM images present for example in the Knoppix CD-ROMs. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +The \s-1HTML\s0 documentation of \s-1QEMU\s0 for more precise information and Linux +user mode emulator invocation. +.SH "AUTHOR" +.IX Header "AUTHOR" +Fabrice Bellard diff -Naur qemu-kvm-0.13.0/qemu-monitor.texi qemu-0.13.0-patched/qemu-monitor.texi --- qemu-kvm-0.13.0/qemu-monitor.texi 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-monitor.texi 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,419 @@ +@table @option +@item help or ? [@var{cmd}] +@findex help +Show the help for all commands or just for command @var{cmd}. +@item commit +@findex commit +Commit changes to the disk images (if -snapshot is used) or backing files. +@item q or quit +@findex quit +Quit the emulator. +@item eject [-f] @var{device} +@findex eject +Eject a removable medium (use -f to force it). +@item change @var{device} @var{setting} +@findex change + +Change the configuration of a device. + +@table @option +@item change @var{diskdevice} @var{filename} [@var{format}] +Change the medium for a removable disk device to point to @var{filename}. eg + +@example +(qemu) change ide1-cd0 /path/to/some.iso +@end example + +@var{format} is optional. + +@item change vnc @var{display},@var{options} +Change the configuration of the VNC server. The valid syntax for @var{display} +and @var{options} are described at @ref{sec_invocation}. eg + +@example +(qemu) change vnc localhost:1 +@end example + +@item change vnc password [@var{password}] + +Change the password associated with the VNC server. If the new password is not +supplied, the monitor will prompt for it to be entered. VNC passwords are only +significant up to 8 letters. eg + +@example +(qemu) change vnc password +Password: ******** +@end example + +@end table +@item screendump @var{filename} +@findex screendump +Save screen into PPM image @var{filename}. +@item logfile @var{filename} +@findex logfile +Output logs to @var{filename}. +@item log @var{item1}[,...] +@findex log +Activate logging of the specified items to @file{/tmp/qemu.log}. +@item savevm [@var{tag}|@var{id}] +@findex savevm +Create a snapshot of the whole virtual machine. If @var{tag} is +provided, it is used as human readable identifier. If there is already +a snapshot with the same tag or ID, it is replaced. More info at +@ref{vm_snapshots}. +@item loadvm @var{tag}|@var{id} +@findex loadvm +Set the whole virtual machine to the snapshot identified by the tag +@var{tag} or the unique snapshot ID @var{id}. +@item delvm @var{tag}|@var{id} +@findex delvm +Delete the snapshot identified by @var{tag} or @var{id}. +@item singlestep [off] +@findex singlestep +Run the emulation in single step mode. +If called with option off, the emulation returns to normal mode. +@item stop +@findex stop +Stop emulation. +@item c or cont +@findex cont +Resume emulation. +@item gdbserver [@var{port}] +@findex gdbserver +Start gdbserver session (default @var{port}=1234) +@item x/fmt @var{addr} +@findex x +Virtual memory dump starting at @var{addr}. +@item xp /@var{fmt} @var{addr} +@findex xp +Physical memory dump starting at @var{addr}. + +@var{fmt} is a format which tells the command how to format the +data. Its syntax is: @option{/@{count@}@{format@}@{size@}} + +@table @var +@item count +is the number of items to be dumped. + +@item format +can be x (hex), d (signed decimal), u (unsigned decimal), o (octal), +c (char) or i (asm instruction). + +@item size +can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86, +@code{h} or @code{w} can be specified with the @code{i} format to +respectively select 16 or 32 bit code instruction size. + +@end table + +Examples: +@itemize +@item +Dump 10 instructions at the current instruction pointer: +@example +(qemu) x/10i $eip +0x90107063: ret +0x90107064: sti +0x90107065: lea 0x0(%esi,1),%esi +0x90107069: lea 0x0(%edi,1),%edi +0x90107070: ret +0x90107071: jmp 0x90107080 +0x90107073: nop +0x90107074: nop +0x90107075: nop +0x90107076: nop +@end example + +@item +Dump 80 16 bit values at the start of the video memory. +@smallexample +(qemu) xp/80hx 0xb8000 +0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42 +0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41 +0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72 +0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73 +0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20 +0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720 +0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 +0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 +0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 +0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 +@end smallexample +@end itemize +@item p or print/@var{fmt} @var{expr} +@findex print + +Print expression value. Only the @var{format} part of @var{fmt} is +used. +Read I/O port. +Write to I/O port. +@item sendkey @var{keys} +@findex sendkey + +Send @var{keys} to the emulator. @var{keys} could be the name of the +key or @code{#} followed by the raw value in either decimal or hexadecimal +format. Use @code{-} to press several keys simultaneously. Example: +@example +sendkey ctrl-alt-f1 +@end example + +This command is useful to send keys that your graphical user interface +intercepts at low level, such as @code{ctrl-alt-f1} in X Window. +@item system_reset +@findex system_reset + +Reset the system. +@item system_powerdown +@findex system_powerdown + +Power down the system (if supported). +@item sum @var{addr} @var{size} +@findex sum + +Compute the checksum of a memory region. +@item usb_add @var{devname} +@findex usb_add + +Add the USB device @var{devname}. For details of available devices see +@ref{usb_devices} +@item usb_del @var{devname} +@findex usb_del + +Remove the USB device @var{devname} from the QEMU virtual USB +hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor +command @code{info usb} to see the devices you can remove. +@item device_add @var{config} +@findex device_add + +Add device. +@item device_del @var{id} +@findex device_del + +Remove device @var{id}. +@item cpu @var{index} +@findex cpu +Set the default CPU. +@item mouse_move @var{dx} @var{dy} [@var{dz}] +@findex mouse_move +Move the active mouse to the specified coordinates @var{dx} @var{dy} +with optional scroll axis @var{dz}. +@item mouse_button @var{val} +@findex mouse_button +Change the active mouse button state @var{val} (1=L, 2=M, 4=R). +@item mouse_set @var{index} +@findex mouse_set +Set which mouse device receives events at given @var{index}, index +can be obtained with +@example +info mice +@end example +@item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]] +@findex wavcapture +Capture audio into @var{filename}. Using sample rate @var{frequency} +bits per sample @var{bits} and number of channels @var{channels}. + +Defaults: +@itemize @minus +@item Sample rate = 44100 Hz - CD quality +@item Bits = 16 +@item Number of channels = 2 - Stereo +@end itemize +@item stopcapture @var{index} +@findex stopcapture +Stop capture with a given @var{index}, index can be obtained with +@example +info capture +@end example +@item memsave @var{addr} @var{size} @var{file} +@findex memsave +save to disk virtual memory dump starting at @var{addr} of size @var{size}. +@item pmemsave @var{addr} @var{size} @var{file} +@findex pmemsave +save to disk physical memory dump starting at @var{addr} of size @var{size}. +@item boot_set @var{bootdevicelist} +@findex boot_set + +Define new values for the boot device list. Those values will override +the values specified on the command line through the @code{-boot} option. + +The values that can be specified here depend on the machine type, but are +the same that can be specified in the @code{-boot} command line option. +@item nmi @var{cpu} +@findex nmi +Inject an NMI on the given CPU (x86 only). +@item migrate [-d] [-b] [-i] @var{uri} +@findex migrate +Migrate to @var{uri} (using -d to not wait for completion). +-b for migration with full copy of disk +-i for migration with incremental copy of disk (base image is shared) +@item migrate_cancel +@findex migrate_cancel +Cancel the current VM migration. +@item migrate_set_speed @var{value} +@findex migrate_set_speed +Set maximum speed to @var{value} (in bytes) for migrations. +@item migrate_set_downtime @var{second} +@findex migrate_set_downtime +Set maximum tolerated downtime (in seconds) for migration. +@item drive_add +@findex drive_add +Add drive to PCI storage controller. +@item pci_add +@findex pci_add +Hot-add PCI device. +@item pci_del +@findex pci_del +Hot remove PCI device. +@item host_net_add +@findex host_net_add +Add host VLAN client. +@item host_net_remove +@findex host_net_remove +Remove host VLAN client. +@item netdev_add +@findex netdev_add +Add host network device. +@item netdev_del +@findex netdev_del +Remove host network device. +@item hostfwd_add +@findex hostfwd_add +Redirect TCP or UDP connections from host to guest (requires -net user). +@item hostfwd_remove +@findex hostfwd_remove +Remove host-to-guest TCP or UDP redirection. +@item balloon @var{value} +@findex balloon +Request VM to change its memory allocation to @var{value} (in MB). +@item set_link @var{name} [on|off] +@findex set_link +Switch link @var{name} on (i.e. up) or off (i.e. down). +@item watchdog_action +@findex watchdog_action +Change watchdog action. +@item acl_show @var{aclname} +@findex acl_show +List all the matching rules in the access control list, and the default +policy. There are currently two named access control lists, +@var{vnc.x509dname} and @var{vnc.username} matching on the x509 client +certificate distinguished name, and SASL username respectively. +@item acl_policy @var{aclname} @code{allow|deny} +@findex acl_policy +Set the default access control list policy, used in the event that +none of the explicit rules match. The default policy at startup is +always @code{deny}. +@item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}] +@findex acl_add +Add a match rule to the access control list, allowing or denying access. +The match will normally be an exact username or x509 distinguished name, +but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to +allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will +normally be appended to the end of the ACL, but can be inserted +earlier in the list if the optional @var{index} parameter is supplied. +@item acl_remove @var{aclname} @var{match} +@findex acl_remove +Remove the specified match rule from the access control list. +@item acl_reset @var{aclname} +@findex acl_reset +Remove all matches from the access control list, and set the default +policy back to @code{deny}. +@item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc} +@findex mce (x86) +Inject an MCE on the given CPU (x86 only). +@item getfd @var{fdname} +@findex getfd +If a file descriptor is passed alongside this command using the SCM_RIGHTS +mechanism on unix sockets, it is stored using the name @var{fdname} for +later use by other monitor commands. +@item closefd @var{fdname} +@findex closefd +Close the file descriptor previously assigned to @var{fdname} using the +@code{getfd} command. This is only needed if the file descriptor was never +used by another monitor command. +@item block_passwd @var{device} @var{password} +@findex block_passwd +Set the encrypted device @var{device} password to @var{password} +@item cpu_set @var{cpu} [online|offline] +Set CPU @var{cpu} online or offline. +@item qmp_capabilities +@findex qmp_capabilities +Enable the specified QMP capabilities +@item info @var{subcommand} +@findex info +Show various information about the system state. + +@table @option +@item info version +show the version of QEMU +@item info commands +list QMP available commands +@item info network +show the various VLANs and the associated devices +@item info chardev +show the character devices +@item info block +show the block devices +@item info blockstats +show block device statistics +@item info registers +show the cpu registers +@item info cpus +show infos for each CPU +@item info history +show the command line history +@item info irq +show the interrupts statistics (if available) +@item info pic +show i8259 (PIC) state +@item info pci +show emulated PCI device info +@item info tlb +show virtual to physical memory mappings (i386 only) +@item info mem +show the active virtual memory mappings (i386 only) +@item info jit +show dynamic compiler info +@item info kvm +show KVM information +@item info numa +show NUMA information +@item info kvm +show KVM information +@item info usb +show USB devices plugged on the virtual USB hub +@item info usbhost +show all USB host devices +@item info profile +show profiling information +@item info capture +show information about active capturing +@item info snapshots +show list of VM snapshots +@item info status +show the current VM status (running|paused) +@item info pcmcia +show guest PCMCIA status +@item info mice +show which guest mouse is receiving events +@item info vnc +show the vnc server status +@item info name +show the current VM name +@item info uuid +show the current VM UUID +@item info cpustats +show CPU statistics +@item info usernet +show user network stack connection states +@item info migrate +show migration status +@item info balloon +show balloon information +@item info qtree +show device tree +@item info qdm +show qdev device model list +@item info roms +show roms +@end table +@end table diff -Naur qemu-kvm-0.13.0/qemu-nbd.8 qemu-0.13.0-patched/qemu-nbd.8 --- qemu-kvm-0.13.0/qemu-nbd.8 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-nbd.8 2011-06-19 16:52:33.000000000 -0400 @@ -0,0 +1,229 @@ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "QEMU-NBD 8" +.TH QEMU-NBD 8 "2011-06-19" " " " " +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +qemu\-nbd \- QEMU Disk Network Block Device Server +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +usage: qemu-nbd [\s-1OPTION\s0]... \fIfilename\fR +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Export Qemu disk image using \s-1NBD\s0 protocol. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fIfilename\fR" 4 +.IX Item "filename" +.Vb 1 +\& is a disk image filename +.Ve +.IP "\fB\-p, \-\-port=\fR\fIport\fR" 4 +.IX Item "-p, --port=port" +.Vb 1 +\& port to listen on (default B<1024>) +.Ve +.IP "\fB\-o, \-\-offset=\fR\fIoffset\fR" 4 +.IX Item "-o, --offset=offset" +.Vb 1 +\& offset into the image +.Ve +.IP "\fB\-b, \-\-bind=\fR\fIiface\fR" 4 +.IX Item "-b, --bind=iface" +.Vb 1 +\& interface to bind to (default B<0.0.0.0>) +.Ve +.IP "\fB\-k, \-\-socket=\fR\fIpath\fR" 4 +.IX Item "-k, --socket=path" +.Vb 1 +\& Use a unix socket with path I +.Ve +.IP "\fB\-r, \-\-read\-only\fR" 4 +.IX Item "-r, --read-only" +.Vb 1 +\& export read\-only +.Ve +.IP "\fB\-P, \-\-partition=\fR\fInum\fR" 4 +.IX Item "-P, --partition=num" +.Vb 1 +\& only expose partition I +.Ve +.IP "\fB\-s, \-\-snapshot\fR" 4 +.IX Item "-s, --snapshot" +.Vb 1 +\& use snapshot file +.Ve +.IP "\fB\-n, \-\-nocache\fR" 4 +.IX Item "-n, --nocache" +.Vb 1 +\& disable host cache +.Ve +.IP "\fB\-c, \-\-connect=\fR\fIdev\fR" 4 +.IX Item "-c, --connect=dev" +.Vb 1 +\& connect I to NBD device I +.Ve +.IP "\fB\-d, \-\-disconnect\fR" 4 +.IX Item "-d, --disconnect" +.Vb 1 +\& disconnect the specified device +.Ve +.IP "\fB\-e, \-\-shared=\fR\fInum\fR" 4 +.IX Item "-e, --shared=num" +.Vb 1 +\& device can be shared by I clients (default B<1>) +.Ve +.IP "\fB\-t, \-\-persistent\fR" 4 +.IX Item "-t, --persistent" +.Vb 1 +\& don\*(Aqt exit on the last connection +.Ve +.IP "\fB\-v, \-\-verbose\fR" 4 +.IX Item "-v, --verbose" +.Vb 1 +\& display extra debugging information +.Ve +.IP "\fB\-h, \-\-help\fR" 4 +.IX Item "-h, --help" +.Vb 1 +\& display this help and exit +.Ve +.IP "\fB\-V, \-\-version\fR" 4 +.IX Item "-V, --version" +.Vb 1 +\& output version information and exit +.Ve +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIqemu\-img\fR\|(1) +.SH "AUTHOR" +.IX Header "AUTHOR" +Copyright (C) 2006 Anthony Liguori . +This is free software; see the source for copying conditions. There is \s-1NO\s0 +warranty; not even for \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. diff -Naur qemu-kvm-0.13.0/qemu-options.hx qemu-0.13.0-patched/qemu-options.hx --- qemu-kvm-0.13.0/qemu-options.hx 2010-10-14 11:06:47.000000000 -0400 +++ qemu-0.13.0-patched/qemu-options.hx 2011-06-19 16:52:11.000000000 -0400 @@ -998,6 +998,8 @@ " connect the vlan 'n' to another VLAN using a socket connection\n" "-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port]\n" " connect the vlan 'n' to multicast maddr and port\n" + "-net udp[,vlan=n]sport=sport,dport=dport,daddr=host\n" + " connect the vlan 'n' to a udp host (for Dynamips/GNS3)\n" #ifdef CONFIG_VDE "-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n" " connect the vlan 'n' to port 'n' of a vde switch running\n" diff -Naur qemu-kvm-0.13.0/qemu-options.texi qemu-0.13.0-patched/qemu-options.texi --- qemu-kvm-0.13.0/qemu-options.texi 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-options.texi 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,1466 @@ +Standard options: +@table @option +@item -h +@findex -h +Display help and exit +@item -version +@findex -version +Display version information and exit +@item -M @var{machine} +@findex -M +Select the emulated @var{machine} (@code{-M ?} for list) +@item -cpu @var{model} +@findex -cpu +Select CPU model (-cpu ? for list and additional feature selection) +@item -smp @var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}] +@findex -smp +Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255 +CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs +to 4. +For the PC target, the number of @var{cores} per socket, the number +of @var{threads} per cores and the total number of @var{sockets} can be +specified. Missing values will be computed. If any on the three values is +given, the total number of CPUs @var{n} can be omitted. @var{maxcpus} +specifies the maximum number of hotpluggable CPUs. +@item -numa @var{opts} +@findex -numa +Simulate a multi node NUMA system. If mem and cpus are omitted, resources +are split equally. +@item -fda @var{file} +@item -fdb @var{file} +@findex -fda +@findex -fdb +Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can +use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}). +@item -hda @var{file} +@item -hdb @var{file} +@item -hdc @var{file} +@item -hdd @var{file} +@findex -hda +@findex -hdb +@findex -hdc +@findex -hdd +Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}). +@item -cdrom @var{file} +@findex -cdrom +Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and +@option{-cdrom} at the same time). You can use the host CD-ROM by +using @file{/dev/cdrom} as filename (@pxref{host_drives}). +@item -drive @var{option}[,@var{option}[,@var{option}[,...]]] +@findex -drive + +Define a new drive. Valid options are: + +@table @option +@item file=@var{file} +This option defines which disk image (@pxref{disk_images}) to use with +this drive. If the filename contains comma, you must double it +(for instance, "file=my,,file" to use file "my,file"). +@item if=@var{interface} +This option defines on which type on interface the drive is connected. +Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio. +@item bus=@var{bus},unit=@var{unit} +These options define where is connected the drive by defining the bus number and +the unit id. +@item index=@var{index} +This option defines where is connected the drive by using an index in the list +of available connectors of a given interface type. +@item media=@var{media} +This option defines the type of the media: disk or cdrom. +@item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}] +These options have the same definition as they have in @option{-hdachs}. +@item snapshot=@var{snapshot} +@var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}). +@item cache=@var{cache} +@var{cache} is "none", "writeback", "unsafe", or "writethrough" and controls how the host cache is used to access block data. +@item aio=@var{aio} +@var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO. +@item format=@var{format} +Specify which disk @var{format} will be used rather than detecting +the format. Can be used to specifiy format=raw to avoid interpreting +an untrusted format header. +@item serial=@var{serial} +This option specifies the serial number to assign to the device. +@item addr=@var{addr} +Specify the controller's PCI address (if=virtio only). +@item boot=@var{boot} +@var{boot} is "on" or "off" and allows for booting from non-traditional interfaces, such as virtio. +@end table + +By default, writethrough caching is used for all block device. This means that +the host page cache will be used to read and write data but write notification +will be sent to the guest only when the data has been reported as written by +the storage subsystem. + +Writeback caching will report data writes as completed as soon as the data is +present in the host page cache. This is safe as long as you trust your host. +If your host crashes or loses power, then the guest may experience data +corruption. + +The host page cache can be avoided entirely with @option{cache=none}. This will +attempt to do disk IO directly to the guests memory. QEMU may still perform +an internal copy of the data. + +Some block drivers perform badly with @option{cache=writethrough}, most notably, +qcow2. If performance is more important than correctness, +@option{cache=writeback} should be used with qcow2. + +In case you don't care about data integrity over host failures, use +cache=unsafe. This option tells qemu that it never needs to write any data +to the disk but can instead keeps things in cache. If anything goes wrong, +like your host losing power, the disk storage getting disconnected accidently, +etc. you're image will most probably be rendered unusable. When using +the @option{-snapshot} option, unsafe caching is always used. + +Instead of @option{-cdrom} you can use: +@example +qemu -drive file=file,index=2,media=cdrom +@end example + +Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can +use: +@example +qemu -drive file=file,index=0,media=disk +qemu -drive file=file,index=1,media=disk +qemu -drive file=file,index=2,media=disk +qemu -drive file=file,index=3,media=disk +@end example + +You can connect a CDROM to the slave of ide0: +@example +qemu -drive file=file,if=ide,index=1,media=cdrom +@end example + +If you don't specify the "file=" argument, you define an empty drive: +@example +qemu -drive if=ide,index=1,media=cdrom +@end example + +You can connect a SCSI disk with unit ID 6 on the bus #0: +@example +qemu -drive file=file,if=scsi,bus=0,unit=6 +@end example + +Instead of @option{-fda}, @option{-fdb}, you can use: +@example +qemu -drive file=file,index=0,if=floppy +qemu -drive file=file,index=1,if=floppy +@end example + +By default, @var{interface} is "ide" and @var{index} is automatically +incremented: +@example +qemu -drive file=a -drive file=b" +@end example +is interpreted like: +@example +qemu -hda a -hdb b +@end example +@item -set +@findex -set +TODO +@item -global +@findex -global +TODO +@item -mtdblock @var{file} +@findex -mtdblock +Use @var{file} as on-board Flash memory image. +@item -sd @var{file} +@findex -sd +Use @var{file} as SecureDigital card image. +@item -pflash @var{file} +@findex -pflash +Use @var{file} as a parallel flash image. +@item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off] +@findex -boot +Specify boot order @var{drives} as a string of drive letters. Valid +drive letters depend on the target achitecture. The x86 PC uses: a, b +(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot +from network adapter 1-4), hard disk boot is the default. To apply a +particular boot order only on the first startup, specify it via +@option{once}. + +Interactive boot menus/prompts can be enabled via @option{menu=on} as far +as firmware/BIOS supports them. The default is non-interactive boot. + +@example +# try to boot from network first, then from hard disk +qemu -boot order=nc +# boot from CD-ROM first, switch back to default order after reboot +qemu -boot once=d +@end example + +Note: The legacy format '-boot @var{drives}' is still supported but its +use is discouraged as it may be removed from future versions. +@item -snapshot +@findex -snapshot +Write to temporary files instead of disk image files. In this case, +the raw disk image you use is not written back. You can however force +the write back by pressing @key{C-a s} (@pxref{disk_images}). +@item -m @var{megs} +@findex -m +Set virtual RAM size to @var{megs} megabytes. Default is 128 MiB. Optionally, +a suffix of ``M'' or ``G'' can be used to signify a value in megabytes or +gigabytes respectively. +@item -mem-path @var{path} +Allocate guest RAM from a temporarily created file in @var{path}. +@item -mem-prealloc +Preallocate memory when using -mem-path. +@item -k @var{language} +@findex -k +Use keyboard layout @var{language} (for example @code{fr} for +French). This option is only needed where it is not easy to get raw PC +keycodes (e.g. on Macs, with some X11 servers or with a VNC +display). You don't normally need to use it on PC/Linux or PC/Windows +hosts. + +The available layouts are: +@example +ar de-ch es fo fr-ca hu ja mk no pt-br sv +da en-gb et fr fr-ch is lt nl pl ru th +de en-us fi fr-be hr it lv nl-be pt sl tr +@end example + +The default is @code{en-us}. +@item -audio-help +@findex -audio-help +Will show the audio subsystem help: list of drivers, tunable +parameters. +@item -soundhw @var{card1}[,@var{card2},...] or -soundhw all +@findex -soundhw +Enable audio and selected sound hardware. Use ? to print all +available sound hardware. + +@example +qemu -soundhw sb16,adlib disk.img +qemu -soundhw es1370 disk.img +qemu -soundhw ac97 disk.img +qemu -soundhw all disk.img +qemu -soundhw ? +@end example + +Note that Linux's i810_audio OSS kernel (for AC97) module might +require manually specifying clocking. + +@example +modprobe i810_audio clocking=48000 +@end example +@end table +USB options: +@table @option + +@item -usb +@findex -usb +Enable the USB driver (will be the default soon) + +@item -usbdevice @var{devname} +@findex -usbdevice +Add the USB device @var{devname}. @xref{usb_devices}. + +@table @option + +@item mouse +Virtual Mouse. This will override the PS/2 mouse emulation when activated. + +@item tablet +Pointer device that uses absolute coordinates (like a touchscreen). This +means qemu is able to report the mouse position without having to grab the +mouse. Also overrides the PS/2 mouse emulation when activated. + +@item disk:[format=@var{format}]:@var{file} +Mass storage device based on file. The optional @var{format} argument +will be used rather than detecting the format. Can be used to specifiy +@code{format=raw} to avoid interpreting an untrusted format header. + +@item host:@var{bus}.@var{addr} +Pass through the host device identified by @var{bus}.@var{addr} (Linux only). + +@item host:@var{vendor_id}:@var{product_id} +Pass through the host device identified by @var{vendor_id}:@var{product_id} +(Linux only). + +@item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev} +Serial converter to host character device @var{dev}, see @code{-serial} for the +available devices. + +@item braille +Braille device. This will use BrlAPI to display the braille output on a real +or fake device. + +@item net:@var{options} +Network adapter that supports CDC ethernet and RNDIS protocols. + +@end table +@item -device @var{driver}[,@var{prop}[=@var{value}][,...]] +@findex -device +Add device @var{driver}. @var{prop}=@var{value} sets driver +properties. Valid properties depend on the driver. To get help on +possible drivers and properties, use @code{-device ?} and +@code{-device @var{driver},?}. +File system options: + +The general form of a File system device option is: +@table @option + +@item -fsdev @var{fstype} ,id=@var{id} [,@var{options}] +@findex -fsdev +Fstype is one of: +@option{local}, +The specific Fstype will determine the applicable options. + +Options to each backend are described below. + +@item -fsdev local ,id=@var{id} ,path=@var{path} ,security_model=@var{security_model} + +Create a file-system-"device" for local-filesystem. + +@option{local} is only available on Linux. + +@option{path} specifies the path to be exported. @option{path} is required. + +@option{security_model} specifies the security model to be followed. +@option{security_model} is required. + +@end table +Virtual File system pass-through options: + +The general form of a Virtual File system pass-through option is: +@table @option + +@item -virtfs @var{fstype} [,@var{options}] +@findex -virtfs +Fstype is one of: +@option{local}, +The specific Fstype will determine the applicable options. + +Options to each backend are described below. + +@item -virtfs local ,path=@var{path} ,mount_tag=@var{mount_tag} ,security_model=@var{security_model} + +Create a Virtual file-system-pass through for local-filesystem. + +@option{local} is only available on Linux. + +@option{path} specifies the path to be exported. @option{path} is required. + +@option{security_model} specifies the security model to be followed. +@option{security_model} is required. + + +@option{mount_tag} specifies the tag with which the exported file is mounted. +@option{mount_tag} is required. + +@end table + +@item -name @var{name} +@findex -name +Sets the @var{name} of the guest. +This name will be displayed in the SDL window caption. +The @var{name} will also be used for the VNC server. +Also optionally set the top visible process name in Linux. +@item -uuid @var{uuid} +@findex -uuid +Set system UUID. +@end table + +Display options: +@table @option +@item -nographic +@findex -nographic +Normally, QEMU uses SDL to display the VGA output. With this option, +you can totally disable graphical output so that QEMU is a simple +command line application. The emulated serial port is redirected on +the console. Therefore, you can still use QEMU to debug a Linux kernel +with a serial console. +@item -curses +@findex curses +Normally, QEMU uses SDL to display the VGA output. With this option, +QEMU can display the VGA output when in text mode using a +curses/ncurses interface. Nothing is displayed in graphical mode. +@item -no-frame +@findex -no-frame +Do not use decorations for SDL windows and start them using the whole +available screen space. This makes the using QEMU in a dedicated desktop +workspace more convenient. +@item -alt-grab +@findex -alt-grab +Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). +@item -ctrl-grab +@findex -ctrl-grab +Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). +@item -no-quit +@findex -no-quit +Disable SDL window close capability. +@item -sdl +@findex -sdl +Enable SDL. +@item -portrait +@findex -portrait +Rotate graphical output 90 deg left (only PXA LCD). +@item -vga @var{type} +@findex -vga +Select type of VGA card to emulate. Valid values for @var{type} are +@table @option +@item cirrus +Cirrus Logic GD5446 Video card. All Windows versions starting from +Windows 95 should recognize and use this graphic card. For optimal +performances, use 16 bit color depth in the guest and the host OS. +(This one is the default) +@item std +Standard VGA card with Bochs VBE extensions. If your guest OS +supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want +to use high resolution modes (>= 1280x1024x16) then you should use +this option. +@item vmware +VMWare SVGA-II compatible adapter. Use it if you have sufficiently +recent XFree86/XOrg server or Windows guest with a driver for this +card. +@item none +Disable VGA card. +@end table +@item -full-screen +@findex -full-screen +Start in full screen. +@item -g @var{width}x@var{height}[x@var{depth}] +@findex -g +Set the initial graphical resolution and depth (PPC, SPARC only). +@item -vnc @var{display}[,@var{option}[,@var{option}[,...]]] +@findex -vnc +Normally, QEMU uses SDL to display the VGA output. With this option, +you can have QEMU listen on VNC display @var{display} and redirect the VGA +display over the VNC session. It is very useful to enable the usb +tablet device when using this option (option @option{-usbdevice +tablet}). When using the VNC display, you must use the @option{-k} +parameter to set the keyboard layout if you are not using en-us. Valid +syntax for the @var{display} is + +@table @option + +@item @var{host}:@var{d} + +TCP connections will only be allowed from @var{host} on display @var{d}. +By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can +be omitted in which case the server will accept connections from any host. + +@item unix:@var{path} + +Connections will be allowed over UNIX domain sockets where @var{path} is the +location of a unix socket to listen for connections on. + +@item none + +VNC is initialized but not started. The monitor @code{change} command +can be used to later start the VNC server. + +@end table + +Following the @var{display} value there may be one or more @var{option} flags +separated by commas. Valid options are + +@table @option + +@item reverse + +Connect to a listening VNC client via a ``reverse'' connection. The +client is specified by the @var{display}. For reverse network +connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument +is a TCP port number, not a display number. + +@item password + +Require that password based authentication is used for client connections. +The password must be set separately using the @code{change} command in the +@ref{pcsys_monitor} + +@item tls + +Require that client use TLS when communicating with the VNC server. This +uses anonymous TLS credentials so is susceptible to a man-in-the-middle +attack. It is recommended that this option be combined with either the +@option{x509} or @option{x509verify} options. + +@item x509=@var{/path/to/certificate/dir} + +Valid if @option{tls} is specified. Require that x509 credentials are used +for negotiating the TLS session. The server will send its x509 certificate +to the client. It is recommended that a password be set on the VNC server +to provide authentication of the client when this is used. The path following +this option specifies where the x509 certificates are to be loaded from. +See the @ref{vnc_security} section for details on generating certificates. + +@item x509verify=@var{/path/to/certificate/dir} + +Valid if @option{tls} is specified. Require that x509 credentials are used +for negotiating the TLS session. The server will send its x509 certificate +to the client, and request that the client send its own x509 certificate. +The server will validate the client's certificate against the CA certificate, +and reject clients when validation fails. If the certificate authority is +trusted, this is a sufficient authentication mechanism. You may still wish +to set a password on the VNC server as a second authentication layer. The +path following this option specifies where the x509 certificates are to +be loaded from. See the @ref{vnc_security} section for details on generating +certificates. + +@item sasl + +Require that the client use SASL to authenticate with the VNC server. +The exact choice of authentication method used is controlled from the +system / user's SASL configuration file for the 'qemu' service. This +is typically found in /etc/sasl2/qemu.conf. If running QEMU as an +unprivileged user, an environment variable SASL_CONF_PATH can be used +to make it search alternate locations for the service config. +While some SASL auth methods can also provide data encryption (eg GSSAPI), +it is recommended that SASL always be combined with the 'tls' and +'x509' settings to enable use of SSL and server certificates. This +ensures a data encryption preventing compromise of authentication +credentials. See the @ref{vnc_security} section for details on using +SASL authentication. + +@item acl + +Turn on access control lists for checking of the x509 client certificate +and SASL party. For x509 certs, the ACL check is made against the +certificate's distinguished name. This is something that looks like +@code{C=GB,O=ACME,L=Boston,CN=bob}. For SASL party, the ACL check is +made against the username, which depending on the SASL plugin, may +include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}. +When the @option{acl} flag is set, the initial access list will be +empty, with a @code{deny} policy. Thus no one will be allowed to +use the VNC server until the ACLs have been loaded. This can be +achieved using the @code{acl} monitor command. + +@item lossy + +Enable lossy compression methods (gradient, JPEG, ...). If this +option is set, VNC client may receive lossy framebuffer updates +depending on its encoding settings. Enabling this option can save +a lot of bandwidth at the expense of quality. + +@end table +@end table + +i386 target only: +@table @option +@item -win2k-hack +@findex -win2k-hack +Use it when installing Windows 2000 to avoid a disk full bug. After +Windows 2000 is installed, you no longer need this option (this option +slows down the IDE transfers). +@item -no-fd-bootchk +@findex -no-fd-bootchk +Disable boot signature checking for floppy disks in Bochs BIOS. It may +be needed to boot from old floppy disks. +TODO: check reference to Bochs BIOS. +@item -no-acpi +@findex -no-acpi +Disable ACPI (Advanced Configuration and Power Interface) support. Use +it if your guest OS complains about ACPI problems (PC target machine +only). +@item -no-hpet +@findex -no-hpet +Disable HPET support. +@item -balloon none +@findex -balloon +Disable balloon device. +@item -balloon virtio[,addr=@var{addr}] +Enable virtio balloon device (default), optionally with PCI address +@var{addr}. +@item -acpitable [sig=@var{str}][,rev=@var{n}][,oem_id=@var{str}][,oem_table_id=@var{str}][,oem_rev=@var{n}] [,asl_compiler_id=@var{str}][,asl_compiler_rev=@var{n}][,data=@var{file1}[:@var{file2}]...] +@findex -acpitable +Add ACPI table with specified header fields and context from specified files. +@item -smbios file=@var{binary} +@findex -smbios +Load SMBIOS entry from binary file. + +@item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}] +@findex -smbios +Specify SMBIOS type 0 fields + +@item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}] [,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}] [,family=@var{str}] +Specify SMBIOS type 1 fields + +@end table +Network options: +@table @option +@item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}] +@findex -net +Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n} += 0 is the default). The NIC is an e1000 by default on the PC +target. Optionally, the MAC address can be changed to @var{mac}, the +device address set to @var{addr} (PCI cards only), +and a @var{name} can be assigned for use in monitor commands. +Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors +that the card should have; this option currently only affects virtio cards; set +@var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single +NIC is created. Qemu can emulate several different models of network card. +Valid values for @var{type} are +@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er}, +@code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139}, +@code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}. +Not all devices are supported on all targets. Use -net nic,model=? +for a list of available devices for your target. + +@item -net user[,@var{option}][,@var{option}][,...] +Use the user mode network stack which requires no administrator +privilege to run. Valid options are: + +@table @option +@item vlan=@var{n} +Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default). + +@item name=@var{name} +Assign symbolic name for use in monitor commands. + +@item net=@var{addr}[/@var{mask}] +Set IP network address the guest will see. Optionally specify the netmask, +either in the form a.b.c.d or as number of valid top-most bits. Default is +10.0.2.0/8. + +@item host=@var{addr} +Specify the guest-visible address of the host. Default is the 2nd IP in the +guest network, i.e. x.x.x.2. + +@item restrict=y|yes|n|no +If this options is enabled, the guest will be isolated, i.e. it will not be +able to contact the host and no guest IP packets will be routed over the host +to the outside. This option does not affect explicitly set forwarding rule. + +@item hostname=@var{name} +Specifies the client hostname reported by the builtin DHCP server. + +@item dhcpstart=@var{addr} +Specify the first of the 16 IPs the built-in DHCP server can assign. Default +is the 16th to 31st IP in the guest network, i.e. x.x.x.16 to x.x.x.31. + +@item dns=@var{addr} +Specify the guest-visible address of the virtual nameserver. The address must +be different from the host address. Default is the 3rd IP in the guest network, +i.e. x.x.x.3. + +@item tftp=@var{dir} +When using the user mode network stack, activate a built-in TFTP +server. The files in @var{dir} will be exposed as the root of a TFTP server. +The TFTP client on the guest must be configured in binary mode (use the command +@code{bin} of the Unix TFTP client). + +@item bootfile=@var{file} +When using the user mode network stack, broadcast @var{file} as the BOOTP +filename. In conjunction with @option{tftp}, this can be used to network boot +a guest from a local directory. + +Example (using pxelinux): +@example +qemu -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 +@end example + +@item smb=@var{dir}[,smbserver=@var{addr}] +When using the user mode network stack, activate a built-in SMB +server so that Windows OSes can access to the host files in @file{@var{dir}} +transparently. The IP address of the SMB server can be set to @var{addr}. By +default the 4th IP in the guest network is used, i.e. x.x.x.4. + +In the guest Windows OS, the line: +@example +10.0.2.4 smbserver +@end example +must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me) +or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000). + +Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}. + +Note that a SAMBA server must be installed on the host OS in +@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from +Red Hat 9, Fedora Core 3 and OpenSUSE 11.x. + +@item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport} +Redirect incoming TCP or UDP connections to the host port @var{hostport} to +the guest IP address @var{guestaddr} on guest port @var{guestport}. If +@var{guestaddr} is not specified, its value is x.x.x.15 (default first address +given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can +be bound to a specific host interface. If no connection type is set, TCP is +used. This option can be given multiple times. + +For example, to redirect host X11 connection from screen 1 to guest +screen 0, use the following: + +@example +# on the host +qemu -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...] +# this host xterm should open in the guest X11 server +xterm -display :1 +@end example + +To redirect telnet connections from host port 5555 to telnet port on +the guest, use the following: + +@example +# on the host +qemu -net user,hostfwd=tcp::5555-:23 [...] +telnet localhost 5555 +@end example + +Then when you use on the host @code{telnet localhost 5555}, you +connect to the guest telnet server. + +@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev} +Forward guest TCP connections to the IP address @var{server} on port @var{port} +to the character device @var{dev}. This option can be given multiple times. + +@end table + +Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still +processed and applied to -net user. Mixing them with the new configuration +syntax gives undefined results. Their use for new applications is discouraged +as they will be removed from future versions. + +@item -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}] [,script=@var{file}][,downscript=@var{dfile}] +Connect the host TAP network interface @var{name} to VLAN @var{n}, use +the network script @var{file} to configure it and the network script +@var{dfile} to deconfigure it. If @var{name} is not provided, the OS +automatically provides one. @option{fd}=@var{h} can be used to specify +the handle of an already opened host TAP interface. The default network +configure script is @file{/etc/qemu-ifup} and the default network +deconfigure script is @file{/etc/qemu-ifdown}. Use @option{script=no} +or @option{downscript=no} to disable script execution. Example: + +@example +qemu linux.img -net nic -net tap +@end example + +More complicated example (two NICs, each one connected to a TAP device) +@example +qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ +-net nic,vlan=1 -net tap,vlan=1,ifname=tap1 +@end example + +@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] + +Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual +machine using a TCP socket connection. If @option{listen} is +specified, QEMU waits for incoming connections on @var{port} +(@var{host} is optional). @option{connect} is used to connect to +another QEMU instance using the @option{listen} option. @option{fd}=@var{h} +specifies an already opened TCP socket. + +Example: +@example +# launch a first QEMU instance +qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ +-net socket,listen=:1234 +# connect the VLAN 0 of this instance to the VLAN 0 +# of the first instance +qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ +-net socket,connect=127.0.0.1:1234 +@end example + +@item -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,mcast=@var{maddr}:@var{port}] + +Create a VLAN @var{n} shared with another QEMU virtual +machines using a UDP multicast socket, effectively making a bus for +every QEMU with same multicast address @var{maddr} and @var{port}. +NOTES: +@enumerate +@item +Several QEMU can be running on different hosts and share same bus (assuming +correct multicast setup for these hosts). +@item +mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see +@url{http://user-mode-linux.sf.net}. +@item +Use @option{fd=h} to specify an already opened UDP multicast socket. +@end enumerate + +Example: +@example +# launch one QEMU instance +qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ +-net socket,mcast=230.0.0.1:1234 +# launch another QEMU instance on same "bus" +qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ +-net socket,mcast=230.0.0.1:1234 +# launch yet another QEMU instance on same "bus" +qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \ +-net socket,mcast=230.0.0.1:1234 +@end example + +Example (User Mode Linux compat.): +@example +# launch QEMU instance (note mcast address selected +# is UML's default) +qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ +-net socket,mcast=239.192.168.1:1102 +# launch UML +/path/to/linux ubd0=/path/to/root_fs eth0=mcast +@end example + +@item -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] +Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and +listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname} +and MODE @var{octalmode} to change default ownership and permissions for +communication port. This option is available only if QEMU has been compiled +with vde support enabled. + +Example: +@example +# launch vde switch +vde_switch -F -sock /tmp/myswitch +# launch QEMU instance +qemu linux.img -net nic -net vde,sock=/tmp/myswitch +@end example + +@item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}] +Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default). +At most @var{len} bytes (64k by default) per packet are stored. The file format is +libpcap, so it can be analyzed with tools such as tcpdump or Wireshark. + +@item -net none +Indicate that no network devices should be configured. It is used to +override the default configuration (@option{-net nic -net user}) which +is activated if no @option{-net} options are provided. + +@end table + +Character device options: + +The general form of a character device option is: +@table @option + +@item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}] +@findex -chardev +Backend is one of: +@option{null}, +@option{socket}, +@option{udp}, +@option{msmouse}, +@option{vc}, +@option{file}, +@option{pipe}, +@option{console}, +@option{serial}, +@option{pty}, +@option{stdio}, +@option{braille}, +@option{tty}, +@option{parport}. +The specific backend will determine the applicable options. + +All devices must have an id, which can be any string up to 127 characters long. +It is used to uniquely identify this device in other command line directives. + +A character device may be used in multiplexing mode by multiple front-ends. +The key sequence of @key{Control-a} and @key{c} will rotate the input focus +between attached front-ends. Specify @option{mux=on} to enable this mode. + +Options to each backend are described below. + +@item -chardev null ,id=@var{id} +A void device. This device will not emit any data, and will drop any data it +receives. The null backend does not take any options. + +@item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] + +Create a two-way stream socket, which can be either a TCP or a unix socket. A +unix socket will be created if @option{path} is specified. Behaviour is +undefined if TCP options are specified for a unix socket. + +@option{server} specifies that the socket shall be a listening socket. + +@option{nowait} specifies that QEMU should not block waiting for a client to +connect to a listening socket. + +@option{telnet} specifies that traffic on the socket should interpret telnet +escape sequences. + +TCP and unix socket options are given below: + +@table @option + +@item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay] + +@option{host} for a listening socket specifies the local address to be bound. +For a connecting socket species the remote host to connect to. @option{host} is +optional for listening sockets. If not specified it defaults to @code{0.0.0.0}. + +@option{port} for a listening socket specifies the local port to be bound. For a +connecting socket specifies the port on the remote host to connect to. +@option{port} can be given as either a port number or a service name. +@option{port} is required. + +@option{to} is only relevant to listening sockets. If it is specified, and +@option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up +to and including @option{to} until it succeeds. @option{to} must be specified +as a port number. + +@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. +If neither is specified the socket may use either protocol. + +@option{nodelay} disables the Nagle algorithm. + +@item unix options: path=@var{path} + +@option{path} specifies the local path of the unix socket. @option{path} is +required. + +@end table + +@item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6] + +Sends all traffic from the guest to a remote host over UDP. + +@option{host} specifies the remote host to connect to. If not specified it +defaults to @code{localhost}. + +@option{port} specifies the port on the remote host to connect to. @option{port} +is required. + +@option{localaddr} specifies the local address to bind to. If not specified it +defaults to @code{0.0.0.0}. + +@option{localport} specifies the local port to bind to. If not specified any +available local port will be used. + +@option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used. +If neither is specified the device may use either protocol. + +@item -chardev msmouse ,id=@var{id} + +Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not +take any options. + +@item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]] + +Connect to a QEMU text console. @option{vc} may optionally be given a specific +size. + +@option{width} and @option{height} specify the width and height respectively of +the console, in pixels. + +@option{cols} and @option{rows} specify that the console be sized to fit a text +console with the given dimensions. + +@item -chardev file ,id=@var{id} ,path=@var{path} + +Log all traffic received from the guest to a file. + +@option{path} specifies the path of the file to be opened. This file will be +created if it does not already exist, and overwritten if it does. @option{path} +is required. + +@item -chardev pipe ,id=@var{id} ,path=@var{path} + +Create a two-way connection to the guest. The behaviour differs slightly between +Windows hosts and other hosts: + +On Windows, a single duplex pipe will be created at +@file{\\.pipe\@option{path}}. + +On other hosts, 2 pipes will be created called @file{@option{path}.in} and +@file{@option{path}.out}. Data written to @file{@option{path}.in} will be +received by the guest. Data written by the guest can be read from +@file{@option{path}.out}. QEMU will not create these fifos, and requires them to +be present. + +@option{path} forms part of the pipe path as described above. @option{path} is +required. + +@item -chardev console ,id=@var{id} + +Send traffic from the guest to QEMU's standard output. @option{console} does not +take any options. + +@option{console} is only available on Windows hosts. + +@item -chardev serial ,id=@var{id} ,path=@option{path} + +Send traffic from the guest to a serial device on the host. + +@option{serial} is +only available on Windows hosts. + +@option{path} specifies the name of the serial device to open. + +@item -chardev pty ,id=@var{id} + +Create a new pseudo-terminal on the host and connect to it. @option{pty} does +not take any options. + +@option{pty} is not available on Windows hosts. + +@item -chardev stdio ,id=@var{id} [,signal=on|off] +Connect to standard input and standard output of the qemu process. + +@option{signal} controls if signals are enabled on the terminal, that includes +exiting QEMU with the key sequence @key{Control-c}. This option is enabled by +default, use @option{signal=off} to disable it. + +@option{stdio} is not available on Windows hosts. + +@item -chardev braille ,id=@var{id} + +Connect to a local BrlAPI server. @option{braille} does not take any options. + +@item -chardev tty ,id=@var{id} ,path=@var{path} + +Connect to a local tty device. + +@option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and +DragonFlyBSD hosts. + +@option{path} specifies the path to the tty. @option{path} is required. + +@item -chardev parport ,id=@var{id} ,path=@var{path} + +@option{parport} is only available on Linux, FreeBSD and DragonFlyBSD hosts. + +Connect to a local parallel port. + +@option{path} specifies the path to the parallel port device. @option{path} is +required. + +@end table + +Bluetooth(R) options: +@table @option + +@item -bt hci[...] +@findex -bt +Defines the function of the corresponding Bluetooth HCI. -bt options +are matched with the HCIs present in the chosen machine type. For +example when emulating a machine with only one HCI built into it, only +the first @code{-bt hci[...]} option is valid and defines the HCI's +logic. The Transport Layer is decided by the machine type. Currently +the machines @code{n800} and @code{n810} have one HCI and all other +machines have none. + +@anchor{bt-hcis} +The following three types are recognized: + +@table @option +@item -bt hci,null +(default) The corresponding Bluetooth HCI assumes no internal logic +and will not respond to any HCI commands or emit events. + +@item -bt hci,host[:@var{id}] +(@code{bluez} only) The corresponding HCI passes commands / events +to / from the physical HCI identified by the name @var{id} (default: +@code{hci0}) on the computer running QEMU. Only available on @code{bluez} +capable systems like Linux. + +@item -bt hci[,vlan=@var{n}] +Add a virtual, standard HCI that will participate in the Bluetooth +scatternet @var{n} (default @code{0}). Similarly to @option{-net} +VLANs, devices inside a bluetooth network @var{n} can only communicate +with other devices in the same network (scatternet). +@end table + +@item -bt vhci[,vlan=@var{n}] +(Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached +to the host bluetooth stack instead of to the emulated target. This +allows the host and target machines to participate in a common scatternet +and communicate. Requires the Linux @code{vhci} driver installed. Can +be used as following: + +@example +qemu [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5 +@end example + +@item -bt device:@var{dev}[,vlan=@var{n}] +Emulate a bluetooth device @var{dev} and place it in network @var{n} +(default @code{0}). QEMU can only emulate one type of bluetooth devices +currently: + +@table @option +@item keyboard +Virtual wireless keyboard implementing the HIDP bluetooth profile. +@end table +@end table + +Linux/Multiboot boot specific: + +When using these options, you can use a given Linux or Multiboot +kernel without installing it in the disk image. It can be useful +for easier testing of various kernels. + +@table @option +@item -kernel @var{bzImage} +@findex -kernel +Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel +or in multiboot format. +@item -append @var{cmdline} +@findex -append +Use @var{cmdline} as kernel command line +@item -initrd @var{file} +@findex -initrd +Use @var{file} as initial ram disk. + +@item -initrd "@var{file1} arg=foo,@var{file2}" + +This syntax is only available with multiboot. + +Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the +first module. +@end table + +Debug/Expert options: +@table @option +@item -serial @var{dev} +@findex -serial +Redirect the virtual serial port to host character device +@var{dev}. The default device is @code{vc} in graphical mode and +@code{stdio} in non graphical mode. + +This option can be used several times to simulate up to 4 serial +ports. + +Use @code{-serial none} to disable all serial ports. + +Available character devices are: +@table @option +@item vc[:@var{W}x@var{H}] +Virtual console. Optionally, a width and height can be given in pixel with +@example +vc:800x600 +@end example +It is also possible to specify width or height in characters: +@example +vc:80Cx24C +@end example +@item pty +[Linux only] Pseudo TTY (a new PTY is automatically allocated) +@item none +No device is allocated. +@item null +void device +@item /dev/XXX +[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port +parameters are set according to the emulated ones. +@item /dev/parport@var{N} +[Linux only, parallel port only] Use host parallel port +@var{N}. Currently SPP and EPP parallel port features can be used. +@item file:@var{filename} +Write output to @var{filename}. No character can be read. +@item stdio +[Unix only] standard input/output +@item pipe:@var{filename} +name pipe @var{filename} +@item COM@var{n} +[Windows only] Use host serial port @var{n} +@item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}] +This implements UDP Net Console. +When @var{remote_host} or @var{src_ip} are not specified +they default to @code{0.0.0.0}. +When not using a specified @var{src_port} a random port is automatically chosen. + +If you just want a simple readonly console you can use @code{netcat} or +@code{nc}, by starting qemu with: @code{-serial udp::4555} and nc as: +@code{nc -u -l -p 4555}. Any time qemu writes something to that port it +will appear in the netconsole session. + +If you plan to send characters back via netconsole or you want to stop +and start qemu a lot of times, you should have qemu use the same +source port each time by using something like @code{-serial +udp::4555@@:4556} to qemu. Another approach is to use a patched +version of netcat which can listen to a TCP port and send and receive +characters via udp. If you have a patched version of netcat which +activates telnet remote echo and single char transfer, then you can +use the following options to step up a netcat redirector to allow +telnet on port 5555 to access the qemu port. +@table @code +@item Qemu Options: +-serial udp::4555@@:4556 +@item netcat options: +-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T +@item telnet options: +localhost 5555 +@end table + +@item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay] +The TCP Net Console has two modes of operation. It can send the serial +I/O to a location or wait for a connection from a location. By default +the TCP Net Console is sent to @var{host} at the @var{port}. If you use +the @var{server} option QEMU will wait for a client socket application +to connect to the port before continuing, unless the @code{nowait} +option was specified. The @code{nodelay} option disables the Nagle buffering +algorithm. If @var{host} is omitted, 0.0.0.0 is assumed. Only +one TCP connection at a time is accepted. You can use @code{telnet} to +connect to the corresponding character device. +@table @code +@item Example to send tcp console to 192.168.0.2 port 4444 +-serial tcp:192.168.0.2:4444 +@item Example to listen and wait on port 4444 for connection +-serial tcp::4444,server +@item Example to not wait and listen on ip 192.168.0.100 port 4444 +-serial tcp:192.168.0.100:4444,server,nowait +@end table + +@item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay] +The telnet protocol is used instead of raw tcp sockets. The options +work the same as if you had specified @code{-serial tcp}. The +difference is that the port acts like a telnet server or client using +telnet option negotiation. This will also allow you to send the +MAGIC_SYSRQ sequence if you use a telnet that supports sending the break +sequence. Typically in unix telnet you do it with Control-] and then +type "send break" followed by pressing the enter key. + +@item unix:@var{path}[,server][,nowait] +A unix domain socket is used instead of a tcp socket. The option works the +same as if you had specified @code{-serial tcp} except the unix domain socket +@var{path} is used for connections. + +@item mon:@var{dev_string} +This is a special option to allow the monitor to be multiplexed onto +another serial port. The monitor is accessed with key sequence of +@key{Control-a} and then pressing @key{c}. See monitor access +@ref{pcsys_keys} in the -nographic section for more keys. +@var{dev_string} should be any one of the serial devices specified +above. An example to multiplex the monitor onto a telnet server +listening on port 4444 would be: +@table @code +@item -serial mon:telnet::4444,server,nowait +@end table + +@item braille +Braille device. This will use BrlAPI to display the braille output on a real +or fake device. + +@item msmouse +Three button serial mouse. Configure the guest to use Microsoft protocol. +@end table +@item -parallel @var{dev} +@findex -parallel +Redirect the virtual parallel port to host device @var{dev} (same +devices as the serial port). On Linux hosts, @file{/dev/parportN} can +be used to use hardware devices connected on the corresponding host +parallel port. + +This option can be used several times to simulate up to 3 parallel +ports. + +Use @code{-parallel none} to disable all parallel ports. +@item -monitor @var{dev} +@findex -monitor +Redirect the monitor to host device @var{dev} (same devices as the +serial port). +The default device is @code{vc} in graphical mode and @code{stdio} in +non graphical mode. +@item -qmp @var{dev} +@findex -qmp +Like -monitor but opens in 'control' mode. +@item -mon chardev=[name][,mode=readline|control][,default] +@findex -mon +Setup monitor on chardev @var{name}. +@item -debugcon @var{dev} +@findex -debugcon +Redirect the debug console to host device @var{dev} (same devices as the +serial port). The debug console is an I/O port which is typically port +0xe9; writing to that I/O port sends output to this device. +The default device is @code{vc} in graphical mode and @code{stdio} in +non graphical mode. +@item -pidfile @var{file} +@findex -pidfile +Store the QEMU process PID in @var{file}. It is useful if you launch QEMU +from a script. +@item -singlestep +@findex -singlestep +Run the emulation in single step mode. +@item -S +@findex -S +Do not start CPU at startup (you must type 'c' in the monitor). +@item -gdb @var{dev} +@findex -gdb +Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical +connections will likely be TCP-based, but also UDP, pseudo TTY, or even +stdio are reasonable use case. The latter is allowing to start qemu from +within gdb and establish the connection via a pipe: +@example +(gdb) target remote | exec qemu -gdb stdio ... +@end example +@item -s +@findex -s +Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234 +(@pxref{gdb_usage}). +@item -d +@findex -d +Output log in /tmp/qemu.log +@item -hdachs @var{c},@var{h},@var{s},[,@var{t}] +@findex -hdachs +Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <= +@var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS +translation mode (@var{t}=none, lba or auto). Usually QEMU can guess +all those parameters. This option is useful for old MS-DOS disk +images. +@item -L @var{path} +@findex -L +Set the directory for the BIOS, VGA BIOS and keymaps. +@item -bios @var{file} +@findex -bios +Set the filename for the BIOS. +@item -enable-kvm +@findex -enable-kvm +Enable KVM full virtualization support. This option is only available +if KVM support is enabled when compiling. +@item -xen-domid @var{id} +@findex -xen-domid +Specify xen guest domain @var{id} (XEN only). +@item -xen-create +@findex -xen-create +Create domain using xen hypercalls, bypassing xend. +Warning: should not be used when xend is in use (XEN only). +@item -xen-attach +@findex -xen-attach +Attach to existing xen domain. +xend will use this when starting qemu (XEN only). +@item -no-reboot +@findex -no-reboot +Exit instead of rebooting. +@item -no-shutdown +@findex -no-shutdown +Don't exit QEMU on guest shutdown, but instead only stop the emulation. +This allows for instance switching to monitor to commit changes to the +disk image. +@item -loadvm @var{file} +@findex -loadvm +Start right away with a saved state (@code{loadvm} in monitor) +@item -daemonize +@findex -daemonize +Daemonize the QEMU process after initialization. QEMU will not detach from +standard IO until it is ready to receive connections on any of its devices. +This option is a useful way for external programs to launch QEMU without having +to cope with initialization race conditions. +@item -option-rom @var{file} +@findex -option-rom +Load the contents of @var{file} as an option ROM. +This option is useful to load things like EtherBoot. +@item -clock @var{method} +@findex -clock +Force the use of the given methods for timer alarm. To see what timers +are available use -clock ?. + +@item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew] +@findex -rtc +Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current +UTC or local time, respectively. @code{localtime} is required for correct date in +MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the +format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC. + +By default the RTC is driven by the host system time. This allows to use the +RTC as accurate reference clock inside the guest, specifically if the host +time is smoothly following an accurate external reference clock, e.g. via NTP. +If you want to isolate the guest time from the host, even prevent it from +progressing during suspension, you can set @option{clock} to @code{vm} instead. + +Enable @option{driftfix} (i386 targets only) if you experience time drift problems, +specifically with Windows' ACPI HAL. This option will try to figure out how +many timer interrupts were not processed by the Windows guest and will +re-inject them. +@item -icount [@var{N}|auto] +@findex -icount +Enable virtual instruction counter. The virtual cpu will execute one +instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified +then the virtual cpu speed will be automatically adjusted to keep virtual +time within a few seconds of real time. + +Note that while this option can give deterministic behavior, it does not +provide cycle accurate emulation. Modern CPUs contain superscalar out of +order cores with complex cache hierarchies. The number of instructions +executed often has little or no correlation with actual performance. +@item -watchdog @var{model} +@findex -watchdog +Create a virtual hardware watchdog device. Once enabled (by a guest +action), the watchdog must be periodically polled by an agent inside +the guest or else the guest will be restarted. + +The @var{model} is the model of hardware watchdog to emulate. Choices +for model are: @code{ib700} (iBASE 700) which is a very simple ISA +watchdog with a single timer, or @code{i6300esb} (Intel 6300ESB I/O +controller hub) which is a much more featureful PCI-based dual-timer +watchdog. Choose a model for which your guest has drivers. + +Use @code{-watchdog ?} to list available hardware models. Only one +watchdog can be enabled for a guest. +@item -watchdog-action @var{action} + +The @var{action} controls what QEMU will do when the watchdog timer +expires. +The default is +@code{reset} (forcefully reset the guest). +Other possible actions are: +@code{shutdown} (attempt to gracefully shutdown the guest), +@code{poweroff} (forcefully poweroff the guest), +@code{pause} (pause the guest), +@code{debug} (print a debug message and continue), or +@code{none} (do nothing). + +Note that the @code{shutdown} action requires that the guest responds +to ACPI signals, which it may not be able to do in the sort of +situations where the watchdog would have expired, and thus +@code{-watchdog-action shutdown} is not recommended for production use. + +Examples: + +@table @code +@item -watchdog i6300esb -watchdog-action pause +@item -watchdog ib700 +@end table + +@item -echr @var{numeric_ascii_value} +@findex -echr +Change the escape character used for switching to the monitor when using +monitor and serial sharing. The default is @code{0x01} when using the +@code{-nographic} option. @code{0x01} is equal to pressing +@code{Control-a}. You can select a different character from the ascii +control keys where 1 through 26 map to Control-a through Control-z. For +instance you could use the either of the following to change the escape +character to Control-t. +@table @code +@item -echr 0x14 +@item -echr 20 +@end table +@item -virtioconsole @var{c} +@findex -virtioconsole +Set virtio console. + +This option is maintained for backward compatibility. + +Please use @code{-device virtconsole} for the new way of invocation. +@item -show-cursor +@findex -show-cursor +Show cursor. +@item -tb-size @var{n} +@findex -tb-size +Set TB size. +@item -incoming @var{port} +@findex -incoming +Prepare for incoming migration, listen on @var{port}. +@item -nodefaults +@findex -nodefaults +Don't create default devices. +@item -chroot @var{dir} +@findex -chroot +Immediately before starting guest execution, chroot to the specified +directory. Especially useful in combination with -runas. +@item -runas @var{user} +@findex -runas +Immediately before starting guest execution, drop root privileges, switching +to the specified user. +@item -prom-env @var{variable}=@var{value} +@findex -prom-env +Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only). +@item -semihosting +@findex -semihosting +Semihosting mode (ARM, M68K only). +@item -old-param +@findex -old-param (ARM) +Old param mode (ARM only). +@item -readconfig @var{file} +@findex -readconfig +Read device configuration from @var{file}. +@item -writeconfig @var{file} +@findex -writeconfig +Write device configuration to @var{file}. +@item -nodefconfig +@findex -nodefconfig +Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and +@var{sysconfdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} +option will prevent QEMU from loading these configuration files at startup. +@end table diff -Naur qemu-kvm-0.13.0/qemu-tech.html qemu-0.13.0-patched/qemu-tech.html --- qemu-kvm-0.13.0/qemu-tech.html 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu-tech.html 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,704 @@ + + +QEMU Internals + + + + + + + + + + + +

QEMU Internals

+ + + +

+ +

1 Introduction

+ +

+ + +

1.1 Features

+ +

QEMU is a FAST! processor emulator using a portable dynamic +translator. + +

QEMU has two operating modes: + +

    +
  • Full system emulation. In this mode (full platform virtualization), +QEMU emulates a full system (usually a PC), including a processor and +various peripherals. It can be used to launch several different +Operating Systems at once without rebooting the host machine or to +debug system code. + +
  • User mode emulation. In this mode (application level virtualization), +QEMU can launch processes compiled for one CPU on another CPU, however +the Operating Systems must match. This can be used for example to ease +cross-compilation and cross-debugging. +
+ +

As QEMU requires no host kernel driver to run, it is very safe and +easy to use. + +

QEMU generic features: + +

    +
  • User space only or full system emulation. + +
  • Using dynamic translation to native code for reasonable speed. + +
  • Working on x86, x86_64 and PowerPC32/64 hosts. Being tested on ARM, +HPPA, Sparc32 and Sparc64. Previous versions had some support for +Alpha and S390 hosts, but TCG (see below) doesn't support those yet. + +
  • Self-modifying code support. + +
  • Precise exceptions support. + +
  • The virtual CPU is a library (libqemu) which can be used +in other projects (look at qemu/tests/qruncom.c to have an +example of user mode libqemu usage). + +
  • Floating point library supporting both full software emulation and +native host FPU instructions. + +
+ +

QEMU user mode emulation features: +

    +
  • Generic Linux system call converter, including most ioctls. + +
  • clone() emulation using native CPU clone() to use Linux scheduler for threads. + +
  • Accurate signal handling by remapping host signals to target signals. +
+ +

Linux user emulator (Linux host only) can be used to launch the Wine +Windows API emulator (http://www.winehq.org). A Darwin user +emulator (Darwin hosts only) exists and a BSD user emulator for BSD +hosts is under development. It would also be possible to develop a +similar user emulator for Solaris. + +

QEMU full system emulation features: +

    +
  • QEMU uses a full software MMU for maximum portability. + +
  • QEMU can optionally use an in-kernel accelerator, like kvm. The accelerators +execute some of the guest code natively, while +continuing to emulate the rest of the machine. + +
  • Various hardware devices can be emulated and in some cases, host +devices (e.g. serial and parallel ports, USB, drives) can be used +transparently by the guest Operating System. Host device passthrough +can be used for talking to external physical peripherals (e.g. a +webcam, modem or tape drive). + +
  • Symmetric multiprocessing (SMP) even on a host with a single CPU. On a +SMP host system, QEMU can use only one CPU fully due to difficulty in +implementing atomic memory accesses efficiently. + +
+ +

+ + +

1.2 x86 and x86-64 emulation

+ +

QEMU x86 target features: + +

    +
  • The virtual x86 CPU supports 16 bit and 32 bit addressing with segmentation. +LDT/GDT and IDT are emulated. VM86 mode is also supported to run +DOSEMU. There is some support for MMX/3DNow!, SSE, SSE2, SSE3, SSSE3, +and SSE4 as well as x86-64 SVM. + +
  • Support of host page sizes bigger than 4KB in user mode emulation. + +
  • QEMU can emulate itself on x86. + +
  • An extensive Linux x86 CPU test program is included tests/test-i386. +It can be used to test other x86 virtual CPUs. + +
+ +

Current QEMU limitations: + +

    +
  • Limited x86-64 support. + +
  • IPC syscalls are missing. + +
  • The x86 segment limits and access rights are not tested at every +memory access (yet). Hopefully, very few OSes seem to rely on that for +normal use. + +
+ +

+ + +

1.3 ARM emulation

+ +
    +
  • Full ARM 7 user emulation. + +
  • NWFPE FPU support included in user Linux emulation. + +
  • Can run most ARM Linux binaries. + +
+ +

+ + +

1.4 MIPS emulation

+ +
    +
  • The system emulation allows full MIPS32/MIPS64 Release 2 emulation, +including privileged instructions, FPU and MMU, in both little and big +endian modes. + +
  • The Linux userland emulation can run many 32 bit MIPS Linux binaries. + +
+ +

Current QEMU limitations: + +

    +
  • Self-modifying code is not always handled correctly. + +
  • 64 bit userland emulation is not implemented. + +
  • The system emulation is not complete enough to run real firmware. + +
  • The watchpoint debug facility is not implemented. + +
+ +

+ + +

1.5 PowerPC emulation

+ +
    +
  • Full PowerPC 32 bit emulation, including privileged instructions, +FPU and MMU. + +
  • Can run most PowerPC Linux binaries. + +
+ +

+ + +

1.6 Sparc32 and Sparc64 emulation

+ +
    +
  • Full SPARC V8 emulation, including privileged +instructions, FPU and MMU. SPARC V9 emulation includes most privileged +and VIS instructions, FPU and I/D MMU. Alignment is fully enforced. + +
  • Can run most 32-bit SPARC Linux binaries, SPARC32PLUS Linux binaries and +some 64-bit SPARC Linux binaries. + +
+ +

Current QEMU limitations: + +

    +
  • IPC syscalls are missing. + +
  • Floating point exception support is buggy. + +
  • Atomic instructions are not correctly implemented. + +
  • There are still some problems with Sparc64 emulators. + +
+ +

+ + +

1.7 Other CPU emulation

+ +

In addition to the above, QEMU supports emulation of other CPUs with +varying levels of success. These are: + +

    +
  • Alpha +
  • CRIS +
  • M68k +
  • SH4 +
+ +

+ +

2 QEMU Internals

+ +

+ +

2.1 QEMU compared to other emulators

+ +

Like bochs [3], QEMU emulates an x86 CPU. But QEMU is much faster than +bochs as it uses dynamic compilation. Bochs is closely tied to x86 PC +emulation while QEMU can emulate several processors. + +

Like Valgrind [2], QEMU does user space emulation and dynamic +translation. Valgrind is mainly a memory debugger while QEMU has no +support for it (QEMU could be used to detect out of bound memory +accesses as Valgrind, but it has no support to track uninitialised data +as Valgrind does). The Valgrind dynamic translator generates better code +than QEMU (in particular it does register allocation) but it is closely +tied to an x86 host and target and has no support for precise exceptions +and system emulation. + +

EM86 [4] is the closest project to user space QEMU (and QEMU still uses +some of its code, in particular the ELF file loader). EM86 was limited +to an alpha host and used a proprietary and slow interpreter (the +interpreter part of the FX!32 Digital Win32 code translator [5]). + +

TWIN [6] is a Windows API emulator like Wine. It is less accurate than +Wine but includes a protected mode x86 interpreter to launch x86 Windows +executables. Such an approach has greater potential because most of the +Windows API is executed natively but it is far more difficult to develop +because all the data structures and function parameters exchanged +between the API and the x86 code must be converted. + +

User mode Linux [7] was the only solution before QEMU to launch a +Linux kernel as a process while not needing any host kernel +patches. However, user mode Linux requires heavy kernel patches while +QEMU accepts unpatched Linux kernels. The price to pay is that QEMU is +slower. + +

The Plex86 [8] PC virtualizer is done in the same spirit as the now +obsolete qemu-fast system emulator. It requires a patched Linux kernel +to work (you cannot launch the same kernel on your PC), but the +patches are really small. As it is a PC virtualizer (no emulation is +done except for some privileged instructions), it has the potential of +being faster than QEMU. The downside is that a complicated (and +potentially unsafe) host kernel patch is needed. + +

The commercial PC Virtualizers (VMWare [9], VirtualPC [10], TwoOStwo +[11]) are faster than QEMU, but they all need specific, proprietary +and potentially unsafe host drivers. Moreover, they are unable to +provide cycle exact simulation as an emulator can. + +

VirtualBox [12], Xen [13] and KVM [14] are based on QEMU. QEMU-SystemC +[15] uses QEMU to simulate a system where some hardware devices are +developed in SystemC. + +

+ +

2.2 Portable dynamic translation

+ +

QEMU is a dynamic translator. When it first encounters a piece of code, +it converts it to the host instruction set. Usually dynamic translators +are very complicated and highly CPU dependent. QEMU uses some tricks +which make it relatively easily portable and simple while achieving good +performances. + +

After the release of version 0.9.1, QEMU switched to a new method of +generating code, Tiny Code Generator or TCG. TCG relaxes the +dependency on the exact version of the compiler used. The basic idea +is to split every target instruction into a couple of RISC-like TCG +ops (see target-i386/translate.c). Some optimizations can be +performed at this stage, including liveness analysis and trivial +constant expression evaluation. TCG ops are then implemented in the +host CPU back end, also known as TCG target (see +tcg/i386/tcg-target.c). For more information, please take a +look at tcg/README. + +

+ +

2.3 Condition code optimisations

+ +

Lazy evaluation of CPU condition codes (EFLAGS register on x86) +is important for CPUs where every instruction sets the condition +codes. It tends to be less important on conventional RISC systems +where condition codes are only updated when explicitly requested. On +Sparc64, costly update of both 32 and 64 bit condition codes can be +avoided with lazy evaluation. + +

Instead of computing the condition codes after each x86 instruction, +QEMU just stores one operand (called CC_SRC), the result +(called CC_DST) and the type of operation (called +CC_OP). When the condition codes are needed, the condition +codes can be calculated using this information. In addition, an +optimized calculation can be performed for some instruction types like +conditional branches. + +

CC_OP is almost never explicitly set in the generated code +because it is known at translation time. + +

The lazy condition code evaluation is used on x86, m68k, cris and +Sparc. ARM uses a simplified variant for the N and Z flags. + +

+ +

2.4 CPU state optimisations

+ +

The target CPUs have many internal states which change the way it +evaluates instructions. In order to achieve a good speed, the +translation phase considers that some state information of the virtual +CPU cannot change in it. The state is recorded in the Translation +Block (TB). If the state changes (e.g. privilege level), a new TB will +be generated and the previous TB won't be used anymore until the state +matches the state recorded in the previous TB. For example, if the SS, +DS and ES segments have a zero base, then the translator does not even +generate an addition for the segment base. + +

[The FPU stack pointer register is not handled that way yet]. + +

+ +

2.5 Translation cache

+ +

A 16 MByte cache holds the most recently used translations. For +simplicity, it is completely flushed when it is full. A translation unit +contains just a single basic block (a block of x86 instructions +terminated by a jump or by a virtual CPU state change which the +translator cannot deduce statically). + +

+ +

2.6 Direct block chaining

+ +

After each translated basic block is executed, QEMU uses the simulated +Program Counter (PC) and other cpu state informations (such as the CS +segment base value) to find the next basic block. + +

In order to accelerate the most common cases where the new simulated PC +is known, QEMU can patch a basic block so that it jumps directly to the +next one. + +

The most portable code uses an indirect jump. An indirect jump makes +it easier to make the jump target modification atomic. On some host +architectures (such as x86 or PowerPC), the JUMP opcode is +directly patched so that the block chaining has no overhead. + +

+ + +

2.7 Self-modifying code and translated code invalidation

+ +

Self-modifying code is a special challenge in x86 emulation because no +instruction cache invalidation is signaled by the application when code +is modified. + +

When translated code is generated for a basic block, the corresponding +host page is write protected if it is not already read-only. Then, if +a write access is done to the page, Linux raises a SEGV signal. QEMU +then invalidates all the translated code in the page and enables write +accesses to the page. + +

Correct translated code invalidation is done efficiently by maintaining +a linked list of every translated block contained in a given page. Other +linked lists are also maintained to undo direct block chaining. + +

On RISC targets, correctly written software uses memory barriers and +cache flushes, so some of the protection above would not be +necessary. However, QEMU still requires that the generated code always +matches the target instructions in memory in order to handle +exceptions correctly. + +

+ +

2.8 Exception support

+ +

longjmp() is used when an exception such as division by zero is +encountered. + +

The host SIGSEGV and SIGBUS signal handlers are used to get invalid +memory accesses. The simulated program counter is found by +retranslating the corresponding basic block and by looking where the +host program counter was at the exception point. + +

The virtual CPU cannot retrieve the exact EFLAGS register because +in some cases it is not computed because of condition code +optimisations. It is not a big concern because the emulated code can +still be restarted in any cases. + +

+ +

2.9 MMU emulation

+ +

For system emulation QEMU supports a soft MMU. In that mode, the MMU +virtual to physical address translation is done at every memory +access. QEMU uses an address translation cache to speed up the +translation. + +

In order to avoid flushing the translated code each time the MMU +mappings change, QEMU uses a physically indexed translation cache. It +means that each basic block is indexed with its physical address. + +

When MMU mappings change, only the chaining of the basic blocks is +reset (i.e. a basic block can no longer jump directly to another one). + +

+ +

2.10 Device emulation

+ +

Systems emulated by QEMU are organized by boards. At initialization +phase, each board instantiates a number of CPUs, devices, RAM and +ROM. Each device in turn can assign I/O ports or memory areas (for +MMIO) to its handlers. When the emulation starts, an access to the +ports or MMIO memory areas assigned to the device causes the +corresponding handler to be called. + +

RAM and ROM are handled more optimally, only the offset to the host +memory needs to be added to the guest address. + +

The video RAM of VGA and other display cards is special: it can be +read or written directly like RAM, but write accesses cause the memory +to be marked with VGA_DIRTY flag as well. + +

QEMU supports some device classes like serial and parallel ports, USB, +drives and network devices, by providing APIs for easier connection to +the generic, higher level implementations. The API hides the +implementation details from the devices, like native device use or +advanced block device formats like QCOW. + +

Usually the devices implement a reset method and register support for +saving and loading of the device state. The devices can also use +timers, especially together with the use of bottom halves (BHs). + +

+ +

2.11 Hardware interrupts

+ +

In order to be faster, QEMU does not check at every basic block if an +hardware interrupt is pending. Instead, the user must asynchrously +call a specific function to tell that an interrupt is pending. This +function resets the chaining of the currently executing basic +block. It ensures that the execution will return soon in the main loop +of the CPU emulator. Then the main loop can test if the interrupt is +pending and handle it. + +

+ +

2.12 User emulation specific details

+ +

2.12.1 Linux system call translation

+ +

QEMU includes a generic system call translator for Linux. It means that +the parameters of the system calls can be converted to fix the +endianness and 32/64 bit issues. The IOCTLs are converted with a generic +type description system (see ioctls.h and thunk.c). + +

QEMU supports host CPUs which have pages bigger than 4KB. It records all +the mappings the process does and try to emulated the mmap() +system calls in cases where the host mmap() call would fail +because of bad page alignment. + +

2.12.2 Linux signals

+ +

Normal and real-time signals are queued along with their information +(siginfo_t) as it is done in the Linux kernel. Then an interrupt +request is done to the virtual CPU. When it is interrupted, one queued +signal is handled by generating a stack frame in the virtual CPU as the +Linux kernel does. The sigreturn() system call is emulated to return +from the virtual signal handler. + +

Some signals (such as SIGALRM) directly come from the host. Other +signals are synthetized from the virtual CPU exceptions such as SIGFPE +when a division by zero is done (see main.c:cpu_loop()). + +

The blocked signal mask is still handled by the host Linux kernel so +that most signal system calls can be redirected directly to the host +Linux kernel. Only the sigaction() and sigreturn() system +calls need to be fully emulated (see signal.c). + +

2.12.3 clone() system call and threads

+ +

The Linux clone() system call is usually used to create a thread. QEMU +uses the host clone() system call so that real host threads are created +for each emulated thread. One virtual CPU instance is created for each +thread. + +

The virtual x86 CPU atomic operations are emulated with a global lock so +that their semantic is preserved. + +

Note that currently there are still some locking issues in QEMU. In +particular, the translated cache flush is not protected yet against +reentrancy. + +

2.12.4 Self-virtualization

+ +

QEMU was conceived so that ultimately it can emulate itself. Although +it is not very useful, it is an important test to show the power of the +emulator. + +

Achieving self-virtualization is not easy because there may be address +space conflicts. QEMU user emulators solve this problem by being an +executable ELF shared object as the ld-linux.so ELF interpreter. That +way, it can be relocated at load time. + +

+ +

2.13 Bibliography

+ +
+
[1]
http://citeseer.nj.nec.com/piumarta98optimizing.html, Optimizing +direct threaded code by selective inlining (1998) by Ian Piumarta, Fabio +Riccardi. + +
[2]
http://developer.kde.org/~sewardj/, Valgrind, an open-source +memory debugger for x86-GNU/Linux, by Julian Seward. + +
[3]
http://bochs.sourceforge.net/, the Bochs IA-32 Emulator Project, +by Kevin Lawton et al. + +
[4]
http://www.cs.rose-hulman.edu/~donaldlf/em86/index.html, the EM86 +x86 emulator on Alpha-Linux. + +
[5]
http://www.usenix.org/publications/library/proceedings/usenix-nt97/full_papers/chernoff/chernoff.pdf, +DIGITAL FX!32: Running 32-Bit x86 Applications on Alpha NT, by Anton +Chernoff and Ray Hookway. + +
[6]
http://www.willows.com/, Windows API library emulation from +Willows Software. + +
[7]
http://user-mode-linux.sourceforge.net/, +The User-mode Linux Kernel. + +
[8]
http://www.plex86.org/, +The new Plex86 project. + +
[9]
http://www.vmware.com/, +The VMWare PC virtualizer. + +
[10]
http://www.microsoft.com/windowsxp/virtualpc/, +The VirtualPC PC virtualizer. + +
[11]
http://www.twoostwo.org/, +The TwoOStwo PC virtualizer. + +
[12]
http://virtualbox.org/, +The VirtualBox PC virtualizer. + +
[13]
http://www.xen.org/, +The Xen hypervisor. + +
[14]
http://kvm.qumranet.com/kvmwiki/Front_Page, +Kernel Based Virtual Machine (KVM). + +
[15]
http://www.greensocs.com/projects/QEMUSystemC, +QEMU-SystemC, a hardware co-simulator. + +
+ +

+ +

3 Regression Tests

+ +

In the directory tests/, various interesting testing programs +are available. They are used for regression testing. + +

+ + +

3.1 test-i386

+ +

This program executes most of the 16 bit and 32 bit x86 instructions and +generates a text output. It can be compared with the output obtained with +a real CPU or another emulator. The target make test runs this +program and a diff on the generated output. + +

The Linux system call modify_ldt() is used to create x86 selectors +to test some 16 bit addressing and 32 bit with segmentation cases. + +

The Linux system call vm86() is used to test vm86 emulation. + +

Various exceptions are raised to test most of the x86 user space +exception reporting. + +

+ + +

3.2 linux-test

+ +

This program tests various Linux system calls. It is used to verify +that the system call parameters are correctly converted between target +and host CPUs. + +

+ + +

3.3 qruncom.c

+ +

Example of usage of libqemu to emulate a user mode i386 CPU. + +

+ +

4 Index

+ +
    +
+ + diff -Naur qemu-kvm-0.13.0/qemu.1 qemu-0.13.0-patched/qemu.1 --- qemu-kvm-0.13.0/qemu.1 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/qemu.1 2011-06-19 16:52:33.000000000 -0400 @@ -0,0 +1,1824 @@ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "QEMU 1" +.TH QEMU 1 "2011-06-19" " " " " +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +qemu\-doc \- QEMU Emulator User Documentation +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +usage: qemu [options] [\fIdisk_image\fR] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The \s-1QEMU\s0 \s-1PC\s0 System emulator simulates the +following peripherals: +.IP "\-" 4 +i440FX host \s-1PCI\s0 bridge and \s-1PIIX3\s0 \s-1PCI\s0 to \s-1ISA\s0 bridge +.IP "\-" 4 +Cirrus \s-1CLGD\s0 5446 \s-1PCI\s0 \s-1VGA\s0 card or dummy \s-1VGA\s0 card with Bochs \s-1VESA\s0 +extensions (hardware level, including all non standard modes). +.IP "\-" 4 +\&\s-1PS/2\s0 mouse and keyboard +.IP "\-" 4 +2 \s-1PCI\s0 \s-1IDE\s0 interfaces with hard disk and CD-ROM support +.IP "\-" 4 +Floppy disk +.IP "\-" 4 +\&\s-1PCI\s0 and \s-1ISA\s0 network adapters +.IP "\-" 4 +Serial ports +.IP "\-" 4 +Creative SoundBlaster 16 sound card +.IP "\-" 4 +\&\s-1ENSONIQ\s0 AudioPCI \s-1ES1370\s0 sound card +.IP "\-" 4 +Intel 82801AA \s-1AC97\s0 Audio compatible sound card +.IP "\-" 4 +Adlib(\s-1OPL2\s0) \- Yamaha \s-1YM3812\s0 compatible chip +.IP "\-" 4 +Gravis Ultrasound \s-1GF1\s0 sound card +.IP "\-" 4 +\&\s-1CS4231A\s0 compatible sound card +.IP "\-" 4 +\&\s-1PCI\s0 \s-1UHCI\s0 \s-1USB\s0 controller and a virtual \s-1USB\s0 hub. +.PP +\&\s-1SMP\s0 is supported with up to 255 CPUs. +.PP +Note that adlib, gus and cs4231a are only available when \s-1QEMU\s0 was +configured with \-\-audio\-card\-list option containing the name(s) of +required card(s). +.PP +\&\s-1QEMU\s0 uses the \s-1PC\s0 \s-1BIOS\s0 from the Bochs project and the Plex86/Bochs \s-1LGPL\s0 +\&\s-1VGA\s0 \s-1BIOS\s0. +.PP +\&\s-1QEMU\s0 uses \s-1YM3812\s0 emulation by Tatsuyuki Satoh. +.PP +\&\s-1QEMU\s0 uses \s-1GUS\s0 emulation(\s-1GUSEMU32\s0 <\fBhttp://www.deinmeister.de/gusemu/\fR>) +by Tibor \*(L"\s-1TS\s0\*(R" SchA\*~Xtz. +.PP +Not that, by default, \s-1GUS\s0 shares \s-1\fIIRQ\s0\fR\|(7) with parallel ports and so +qemu must be told to not have parallel ports to have working \s-1GUS\s0 +.PP +.Vb 1 +\& qemu dos.img \-soundhw gus \-parallel none +.Ve +.PP +Alternatively: +.PP +.Vb 1 +\& qemu dos.img \-device gus,irq=5 +.Ve +.PP +Or some other unclaimed \s-1IRQ\s0. +.PP +\&\s-1CS4231A\s0 is the chip used in Windows Sound System and \s-1GUSMAX\s0 products +.SH "OPTIONS" +.IX Header "OPTIONS" +\&\fIdisk_image\fR is a raw hard disk image for \s-1IDE\s0 hard disk 0. Some +targets do not need a disk image. +.PP +Standard options: +.IP "\fB\-h\fR" 4 +.IX Item "-h" +Display help and exit +.IP "\fB\-version\fR" 4 +.IX Item "-version" +Display version information and exit +.IP "\fB\-M\fR \fImachine\fR" 4 +.IX Item "-M machine" +Select the emulated \fImachine\fR (\f(CW\*(C`\-M ?\*(C'\fR for list) +.IP "\fB\-cpu\fR \fImodel\fR" 4 +.IX Item "-cpu model" +Select \s-1CPU\s0 model (\-cpu ? for list and additional feature selection) +.IP "\fB\-smp\fR \fIn\fR\fB[,cores=\fR\fIcores\fR\fB][,threads=\fR\fIthreads\fR\fB][,sockets=\fR\fIsockets\fR\fB][,maxcpus=\fR\fImaxcpus\fR\fB]\fR" 4 +.IX Item "-smp n[,cores=cores][,threads=threads][,sockets=sockets][,maxcpus=maxcpus]" +Simulate an \s-1SMP\s0 system with \fIn\fR CPUs. On the \s-1PC\s0 target, up to 255 +CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs +to 4. +For the \s-1PC\s0 target, the number of \fIcores\fR per socket, the number +of \fIthreads\fR per cores and the total number of \fIsockets\fR can be +specified. Missing values will be computed. If any on the three values is +given, the total number of CPUs \fIn\fR can be omitted. \fImaxcpus\fR +specifies the maximum number of hotpluggable CPUs. +.IP "\fB\-numa\fR \fIopts\fR" 4 +.IX Item "-numa opts" +Simulate a multi node \s-1NUMA\s0 system. If mem and cpus are omitted, resources +are split equally. +.IP "\fB\-fda\fR \fIfile\fR" 4 +.IX Item "-fda file" +.PD 0 +.IP "\fB\-fdb\fR \fIfile\fR" 4 +.IX Item "-fdb file" +.PD +Use \fIfile\fR as floppy disk 0/1 image. You can +use the host floppy by using \fI/dev/fd0\fR as filename. +.IP "\fB\-hda\fR \fIfile\fR" 4 +.IX Item "-hda file" +.PD 0 +.IP "\fB\-hdb\fR \fIfile\fR" 4 +.IX Item "-hdb file" +.IP "\fB\-hdc\fR \fIfile\fR" 4 +.IX Item "-hdc file" +.IP "\fB\-hdd\fR \fIfile\fR" 4 +.IX Item "-hdd file" +.PD +Use \fIfile\fR as hard disk 0, 1, 2 or 3 image. +.IP "\fB\-cdrom\fR \fIfile\fR" 4 +.IX Item "-cdrom file" +Use \fIfile\fR as CD-ROM image (you cannot use \fB\-hdc\fR and +\&\fB\-cdrom\fR at the same time). You can use the host CD-ROM by +using \fI/dev/cdrom\fR as filename. +.IP "\fB\-drive\fR \fIoption\fR\fB[,\fR\fIoption\fR\fB[,\fR\fIoption\fR\fB[,...]]]\fR" 4 +.IX Item "-drive option[,option[,option[,...]]]" +Define a new drive. Valid options are: +.RS 4 +.IP "\fBfile=\fR\fIfile\fR" 4 +.IX Item "file=file" +This option defines which disk image to use with +this drive. If the filename contains comma, you must double it +(for instance, \*(L"file=my,,file\*(R" to use file \*(L"my,file\*(R"). +.IP "\fBif=\fR\fIinterface\fR" 4 +.IX Item "if=interface" +This option defines on which type on interface the drive is connected. +Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio. +.IP "\fBbus=\fR\fIbus\fR\fB,unit=\fR\fIunit\fR" 4 +.IX Item "bus=bus,unit=unit" +These options define where is connected the drive by defining the bus number and +the unit id. +.IP "\fBindex=\fR\fIindex\fR" 4 +.IX Item "index=index" +This option defines where is connected the drive by using an index in the list +of available connectors of a given interface type. +.IP "\fBmedia=\fR\fImedia\fR" 4 +.IX Item "media=media" +This option defines the type of the media: disk or cdrom. +.IP "\fBcyls=\fR\fIc\fR\fB,heads=\fR\fIh\fR\fB,secs=\fR\fIs\fR\fB[,trans=\fR\fIt\fR\fB]\fR" 4 +.IX Item "cyls=c,heads=h,secs=s[,trans=t]" +These options have the same definition as they have in \fB\-hdachs\fR. +.IP "\fBsnapshot=\fR\fIsnapshot\fR" 4 +.IX Item "snapshot=snapshot" +\&\fIsnapshot\fR is \*(L"on\*(R" or \*(L"off\*(R" and allows to enable snapshot for given drive (see \fB\-snapshot\fR). +.IP "\fBcache=\fR\fIcache\fR" 4 +.IX Item "cache=cache" +\&\fIcache\fR is \*(L"none\*(R", \*(L"writeback\*(R", \*(L"unsafe\*(R", or \*(L"writethrough\*(R" and controls how the host cache is used to access block data. +.IP "\fBaio=\fR\fIaio\fR" 4 +.IX Item "aio=aio" +\&\fIaio\fR is \*(L"threads\*(R", or \*(L"native\*(R" and selects between pthread based disk I/O and native Linux \s-1AIO\s0. +.IP "\fBformat=\fR\fIformat\fR" 4 +.IX Item "format=format" +Specify which disk \fIformat\fR will be used rather than detecting +the format. Can be used to specifiy format=raw to avoid interpreting +an untrusted format header. +.IP "\fBserial=\fR\fIserial\fR" 4 +.IX Item "serial=serial" +This option specifies the serial number to assign to the device. +.IP "\fBaddr=\fR\fIaddr\fR" 4 +.IX Item "addr=addr" +Specify the controller's \s-1PCI\s0 address (if=virtio only). +.IP "\fBboot=\fR\fIboot\fR" 4 +.IX Item "boot=boot" +\&\fIboot\fR is \*(L"on\*(R" or \*(L"off\*(R" and allows for booting from non-traditional interfaces, such as virtio. +.RE +.RS 4 +.Sp +By default, writethrough caching is used for all block device. This means that +the host page cache will be used to read and write data but write notification +will be sent to the guest only when the data has been reported as written by +the storage subsystem. +.Sp +Writeback caching will report data writes as completed as soon as the data is +present in the host page cache. This is safe as long as you trust your host. +If your host crashes or loses power, then the guest may experience data +corruption. +.Sp +The host page cache can be avoided entirely with \fBcache=none\fR. This will +attempt to do disk \s-1IO\s0 directly to the guests memory. \s-1QEMU\s0 may still perform +an internal copy of the data. +.Sp +Some block drivers perform badly with \fBcache=writethrough\fR, most notably, +qcow2. If performance is more important than correctness, +\&\fBcache=writeback\fR should be used with qcow2. +.Sp +In case you don't care about data integrity over host failures, use +cache=unsafe. This option tells qemu that it never needs to write any data +to the disk but can instead keeps things in cache. If anything goes wrong, +like your host losing power, the disk storage getting disconnected accidently, +etc. you're image will most probably be rendered unusable. When using +the \fB\-snapshot\fR option, unsafe caching is always used. +.Sp +Instead of \fB\-cdrom\fR you can use: +.Sp +.Vb 1 +\& qemu \-drive file=file,index=2,media=cdrom +.Ve +.Sp +Instead of \fB\-hda\fR, \fB\-hdb\fR, \fB\-hdc\fR, \fB\-hdd\fR, you can +use: +.Sp +.Vb 4 +\& qemu \-drive file=file,index=0,media=disk +\& qemu \-drive file=file,index=1,media=disk +\& qemu \-drive file=file,index=2,media=disk +\& qemu \-drive file=file,index=3,media=disk +.Ve +.Sp +You can connect a \s-1CDROM\s0 to the slave of ide0: +.Sp +.Vb 1 +\& qemu \-drive file=file,if=ide,index=1,media=cdrom +.Ve +.Sp +If you don't specify the \*(L"file=\*(R" argument, you define an empty drive: +.Sp +.Vb 1 +\& qemu \-drive if=ide,index=1,media=cdrom +.Ve +.Sp +You can connect a \s-1SCSI\s0 disk with unit \s-1ID\s0 6 on the bus #0: +.Sp +.Vb 1 +\& qemu \-drive file=file,if=scsi,bus=0,unit=6 +.Ve +.Sp +Instead of \fB\-fda\fR, \fB\-fdb\fR, you can use: +.Sp +.Vb 2 +\& qemu \-drive file=file,index=0,if=floppy +\& qemu \-drive file=file,index=1,if=floppy +.Ve +.Sp +By default, \fIinterface\fR is \*(L"ide\*(R" and \fIindex\fR is automatically +incremented: +.Sp +.Vb 1 +\& qemu \-drive file=a \-drive file=b" +.Ve +.Sp +is interpreted like: +.Sp +.Vb 1 +\& qemu \-hda a \-hdb b +.Ve +.RE +.IP "\fB\-set\fR" 4 +.IX Item "-set" +\&\s-1TODO\s0 +.IP "\fB\-global\fR" 4 +.IX Item "-global" +\&\s-1TODO\s0 +.IP "\fB\-mtdblock\fR \fIfile\fR" 4 +.IX Item "-mtdblock file" +Use \fIfile\fR as on-board Flash memory image. +.IP "\fB\-sd\fR \fIfile\fR" 4 +.IX Item "-sd file" +Use \fIfile\fR as SecureDigital card image. +.IP "\fB\-pflash\fR \fIfile\fR" 4 +.IX Item "-pflash file" +Use \fIfile\fR as a parallel flash image. +.IP "\fB\-boot [order=\fR\fIdrives\fR\fB][,once=\fR\fIdrives\fR\fB][,menu=on|off]\fR" 4 +.IX Item "-boot [order=drives][,once=drives][,menu=on|off]" +Specify boot order \fIdrives\fR as a string of drive letters. Valid +drive letters depend on the target achitecture. The x86 \s-1PC\s0 uses: a, b +(floppy 1 and 2), c (first hard disk), d (first CD-ROM), n\-p (Etherboot +from network adapter 1\-4), hard disk boot is the default. To apply a +particular boot order only on the first startup, specify it via +\&\fBonce\fR. +.Sp +Interactive boot menus/prompts can be enabled via \fBmenu=on\fR as far +as firmware/BIOS supports them. The default is non-interactive boot. +.Sp +.Vb 4 +\& # try to boot from network first, then from hard disk +\& qemu \-boot order=nc +\& # boot from CD\-ROM first, switch back to default order after reboot +\& qemu \-boot once=d +.Ve +.Sp +Note: The legacy format '\-boot \fIdrives\fR' is still supported but its +use is discouraged as it may be removed from future versions. +.IP "\fB\-snapshot\fR" 4 +.IX Item "-snapshot" +Write to temporary files instead of disk image files. In this case, +the raw disk image you use is not written back. You can however force +the write back by pressing \fBC\-a s\fR. +.IP "\fB\-m\fR \fImegs\fR" 4 +.IX Item "-m megs" +Set virtual \s-1RAM\s0 size to \fImegs\fR megabytes. Default is 128 MiB. Optionally, +a suffix of \*(L"M\*(R" or \*(L"G\*(R" can be used to signify a value in megabytes or +gigabytes respectively. +.IP "\fB\-mem\-path\fR \fIpath\fR" 4 +.IX Item "-mem-path path" +Allocate guest \s-1RAM\s0 from a temporarily created file in \fIpath\fR. +.IP "\fB\-mem\-prealloc\fR" 4 +.IX Item "-mem-prealloc" +Preallocate memory when using \-mem\-path. +.IP "\fB\-k\fR \fIlanguage\fR" 4 +.IX Item "-k language" +Use keyboard layout \fIlanguage\fR (for example \f(CW\*(C`fr\*(C'\fR for +French). This option is only needed where it is not easy to get raw \s-1PC\s0 +keycodes (e.g. on Macs, with some X11 servers or with a \s-1VNC\s0 +display). You don't normally need to use it on PC/Linux or PC/Windows +hosts. +.Sp +The available layouts are: +.Sp +.Vb 3 +\& ar de\-ch es fo fr\-ca hu ja mk no pt\-br sv +\& da en\-gb et fr fr\-ch is lt nl pl ru th +\& de en\-us fi fr\-be hr it lv nl\-be pt sl tr +.Ve +.Sp +The default is \f(CW\*(C`en\-us\*(C'\fR. +.IP "\fB\-audio\-help\fR" 4 +.IX Item "-audio-help" +Will show the audio subsystem help: list of drivers, tunable +parameters. +.IP "\fB\-soundhw\fR \fIcard1\fR\fB[,\fR\fIcard2\fR\fB,...] or \-soundhw all\fR" 4 +.IX Item "-soundhw card1[,card2,...] or -soundhw all" +Enable audio and selected sound hardware. Use ? to print all +available sound hardware. +.Sp +.Vb 5 +\& qemu \-soundhw sb16,adlib disk.img +\& qemu \-soundhw es1370 disk.img +\& qemu \-soundhw ac97 disk.img +\& qemu \-soundhw all disk.img +\& qemu \-soundhw ? +.Ve +.Sp +Note that Linux's i810_audio \s-1OSS\s0 kernel (for \s-1AC97\s0) module might +require manually specifying clocking. +.Sp +.Vb 1 +\& modprobe i810_audio clocking=48000 +.Ve +.PP +\&\s-1USB\s0 options: +.IP "\fB\-usb\fR" 4 +.IX Item "-usb" +Enable the \s-1USB\s0 driver (will be the default soon) +.IP "\fB\-usbdevice\fR \fIdevname\fR" 4 +.IX Item "-usbdevice devname" +Add the \s-1USB\s0 device \fIdevname\fR. +.RS 4 +.IP "\fBmouse\fR" 4 +.IX Item "mouse" +Virtual Mouse. This will override the \s-1PS/2\s0 mouse emulation when activated. +.IP "\fBtablet\fR" 4 +.IX Item "tablet" +Pointer device that uses absolute coordinates (like a touchscreen). This +means qemu is able to report the mouse position without having to grab the +mouse. Also overrides the \s-1PS/2\s0 mouse emulation when activated. +.IP "\fBdisk:[format=\fR\fIformat\fR\fB]:\fR\fIfile\fR" 4 +.IX Item "disk:[format=format]:file" +Mass storage device based on file. The optional \fIformat\fR argument +will be used rather than detecting the format. Can be used to specifiy +\&\f(CW\*(C`format=raw\*(C'\fR to avoid interpreting an untrusted format header. +.IP "\fBhost:\fR\fIbus\fR\fB.\fR\fIaddr\fR" 4 +.IX Item "host:bus.addr" +Pass through the host device identified by \fIbus\fR.\fIaddr\fR (Linux only). +.IP "\fBhost:\fR\fIvendor_id\fR\fB:\fR\fIproduct_id\fR" 4 +.IX Item "host:vendor_id:product_id" +Pass through the host device identified by \fIvendor_id\fR:\fIproduct_id\fR +(Linux only). +.IP "\fBserial:[vendorid=\fR\fIvendor_id\fR\fB][,productid=\fR\fIproduct_id\fR\fB]:\fR\fIdev\fR" 4 +.IX Item "serial:[vendorid=vendor_id][,productid=product_id]:dev" +Serial converter to host character device \fIdev\fR, see \f(CW\*(C`\-serial\*(C'\fR for the +available devices. +.IP "\fBbraille\fR" 4 +.IX Item "braille" +Braille device. This will use BrlAPI to display the braille output on a real +or fake device. +.IP "\fBnet:\fR\fIoptions\fR" 4 +.IX Item "net:options" +Network adapter that supports \s-1CDC\s0 ethernet and \s-1RNDIS\s0 protocols. +.RE +.RS 4 +.RE +.IP "\fB\-device\fR \fIdriver\fR\fB[,\fR\fIprop\fR\fB[=\fR\fIvalue\fR\fB][,...]]\fR" 4 +.IX Item "-device driver[,prop[=value][,...]]" +Add device \fIdriver\fR. \fIprop\fR=\fIvalue\fR sets driver +properties. Valid properties depend on the driver. To get help on +possible drivers and properties, use \f(CW\*(C`\-device ?\*(C'\fR and +\&\f(CW\*(C`\-device \f(CIdriver\f(CW,?\*(C'\fR. +File system options: +.Sp +The general form of a File system device option is: +.RS 4 +.IP "\fB\-fsdev\fR \fIfstype\fR \fB,id=\fR\fIid\fR \fB[,\fR\fIoptions\fR\fB]\fR" 4 +.IX Item "-fsdev fstype ,id=id [,options]" +Fstype is one of: +\&\fBlocal\fR, +The specific Fstype will determine the applicable options. +.Sp +Options to each backend are described below. +.IP "\fB\-fsdev local ,id=\fR\fIid\fR \fB,path=\fR\fIpath\fR \fB,security_model=\fR\fIsecurity_model\fR" 4 +.IX Item "-fsdev local ,id=id ,path=path ,security_model=security_model" +Create a file\-system\-\*(L"device\*(R" for local-filesystem. +.Sp +\&\fBlocal\fR is only available on Linux. +.Sp +\&\fBpath\fR specifies the path to be exported. \fBpath\fR is required. +.Sp +\&\fBsecurity_model\fR specifies the security model to be followed. +\&\fBsecurity_model\fR is required. +.RE +.RS 4 +.Sp +Virtual File system pass-through options: +.Sp +The general form of a Virtual File system pass-through option is: +.IP "\fB\-virtfs\fR \fIfstype\fR \fB[,\fR\fIoptions\fR\fB]\fR" 4 +.IX Item "-virtfs fstype [,options]" +Fstype is one of: +\&\fBlocal\fR, +The specific Fstype will determine the applicable options. +.Sp +Options to each backend are described below. +.IP "\fB\-virtfs local ,path=\fR\fIpath\fR \fB,mount_tag=\fR\fImount_tag\fR \fB,security_model=\fR\fIsecurity_model\fR" 4 +.IX Item "-virtfs local ,path=path ,mount_tag=mount_tag ,security_model=security_model" +Create a Virtual file-system-pass through for local-filesystem. +.Sp +\&\fBlocal\fR is only available on Linux. +.Sp +\&\fBpath\fR specifies the path to be exported. \fBpath\fR is required. +.Sp +\&\fBsecurity_model\fR specifies the security model to be followed. +\&\fBsecurity_model\fR is required. +.Sp +\&\fBmount_tag\fR specifies the tag with which the exported file is mounted. +\&\fBmount_tag\fR is required. +.RE +.RS 4 +.RE +.IP "\fB\-name\fR \fIname\fR" 4 +.IX Item "-name name" +Sets the \fIname\fR of the guest. +This name will be displayed in the \s-1SDL\s0 window caption. +The \fIname\fR will also be used for the \s-1VNC\s0 server. +Also optionally set the top visible process name in Linux. +.IP "\fB\-uuid\fR \fIuuid\fR" 4 +.IX Item "-uuid uuid" +Set system \s-1UUID\s0. +.PP +Display options: +.IP "\fB\-nographic\fR" 4 +.IX Item "-nographic" +Normally, \s-1QEMU\s0 uses \s-1SDL\s0 to display the \s-1VGA\s0 output. With this option, +you can totally disable graphical output so that \s-1QEMU\s0 is a simple +command line application. The emulated serial port is redirected on +the console. Therefore, you can still use \s-1QEMU\s0 to debug a Linux kernel +with a serial console. +.IP "\fB\-curses\fR" 4 +.IX Item "-curses" +Normally, \s-1QEMU\s0 uses \s-1SDL\s0 to display the \s-1VGA\s0 output. With this option, +\&\s-1QEMU\s0 can display the \s-1VGA\s0 output when in text mode using a +curses/ncurses interface. Nothing is displayed in graphical mode. +.IP "\fB\-no\-frame\fR" 4 +.IX Item "-no-frame" +Do not use decorations for \s-1SDL\s0 windows and start them using the whole +available screen space. This makes the using \s-1QEMU\s0 in a dedicated desktop +workspace more convenient. +.IP "\fB\-alt\-grab\fR" 4 +.IX Item "-alt-grab" +Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). +.IP "\fB\-ctrl\-grab\fR" 4 +.IX Item "-ctrl-grab" +Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). +.IP "\fB\-no\-quit\fR" 4 +.IX Item "-no-quit" +Disable \s-1SDL\s0 window close capability. +.IP "\fB\-sdl\fR" 4 +.IX Item "-sdl" +Enable \s-1SDL\s0. +.IP "\fB\-portrait\fR" 4 +.IX Item "-portrait" +Rotate graphical output 90 deg left (only \s-1PXA\s0 \s-1LCD\s0). +.IP "\fB\-vga\fR \fItype\fR" 4 +.IX Item "-vga type" +Select type of \s-1VGA\s0 card to emulate. Valid values for \fItype\fR are +.RS 4 +.IP "\fBcirrus\fR" 4 +.IX Item "cirrus" +Cirrus Logic \s-1GD5446\s0 Video card. All Windows versions starting from +Windows 95 should recognize and use this graphic card. For optimal +performances, use 16 bit color depth in the guest and the host \s-1OS\s0. +(This one is the default) +.IP "\fBstd\fR" 4 +.IX Item "std" +Standard \s-1VGA\s0 card with Bochs \s-1VBE\s0 extensions. If your guest \s-1OS\s0 +supports the \s-1VESA\s0 2.0 \s-1VBE\s0 extensions (e.g. Windows \s-1XP\s0) and if you want +to use high resolution modes (>= 1280x1024x16) then you should use +this option. +.IP "\fBvmware\fR" 4 +.IX Item "vmware" +VMWare SVGA-II compatible adapter. Use it if you have sufficiently +recent XFree86/XOrg server or Windows guest with a driver for this +card. +.IP "\fBnone\fR" 4 +.IX Item "none" +Disable \s-1VGA\s0 card. +.RE +.RS 4 +.RE +.IP "\fB\-full\-screen\fR" 4 +.IX Item "-full-screen" +Start in full screen. +.IP "\fB\-g\fR \fIwidth\fR\fBx\fR\fIheight\fR\fB[x\fR\fIdepth\fR\fB]\fR" 4 +.IX Item "-g widthxheight[xdepth]" +Set the initial graphical resolution and depth (\s-1PPC\s0, \s-1SPARC\s0 only). +.IP "\fB\-vnc\fR \fIdisplay\fR\fB[,\fR\fIoption\fR\fB[,\fR\fIoption\fR\fB[,...]]]\fR" 4 +.IX Item "-vnc display[,option[,option[,...]]]" +Normally, \s-1QEMU\s0 uses \s-1SDL\s0 to display the \s-1VGA\s0 output. With this option, +you can have \s-1QEMU\s0 listen on \s-1VNC\s0 display \fIdisplay\fR and redirect the \s-1VGA\s0 +display over the \s-1VNC\s0 session. It is very useful to enable the usb +tablet device when using this option (option \fB\-usbdevice +tablet\fR). When using the \s-1VNC\s0 display, you must use the \fB\-k\fR +parameter to set the keyboard layout if you are not using en-us. Valid +syntax for the \fIdisplay\fR is +.RS 4 +.IP "\fIhost\fR\fB:\fR\fId\fR" 4 +.IX Item "host:d" +\&\s-1TCP\s0 connections will only be allowed from \fIhost\fR on display \fId\fR. +By convention the \s-1TCP\s0 port is 5900+\fId\fR. Optionally, \fIhost\fR can +be omitted in which case the server will accept connections from any host. +.IP "\fBunix:\fR\fIpath\fR" 4 +.IX Item "unix:path" +Connections will be allowed over \s-1UNIX\s0 domain sockets where \fIpath\fR is the +location of a unix socket to listen for connections on. +.IP "\fBnone\fR" 4 +.IX Item "none" +\&\s-1VNC\s0 is initialized but not started. The monitor \f(CW\*(C`change\*(C'\fR command +can be used to later start the \s-1VNC\s0 server. +.RE +.RS 4 +.Sp +Following the \fIdisplay\fR value there may be one or more \fIoption\fR flags +separated by commas. Valid options are +.IP "\fBreverse\fR" 4 +.IX Item "reverse" +Connect to a listening \s-1VNC\s0 client via a \*(L"reverse\*(R" connection. The +client is specified by the \fIdisplay\fR. For reverse network +connections (\fIhost\fR:\fId\fR,\f(CW\*(C`reverse\*(C'\fR), the \fId\fR argument +is a \s-1TCP\s0 port number, not a display number. +.IP "\fBpassword\fR" 4 +.IX Item "password" +Require that password based authentication is used for client connections. +The password must be set separately using the \f(CW\*(C`change\*(C'\fR command in the +\&\fBpcsys_monitor\fR +.IP "\fBtls\fR" 4 +.IX Item "tls" +Require that client use \s-1TLS\s0 when communicating with the \s-1VNC\s0 server. This +uses anonymous \s-1TLS\s0 credentials so is susceptible to a man-in-the-middle +attack. It is recommended that this option be combined with either the +\&\fBx509\fR or \fBx509verify\fR options. +.IP "\fBx509=\fR\fI/path/to/certificate/dir\fR" 4 +.IX Item "x509=/path/to/certificate/dir" +Valid if \fBtls\fR is specified. Require that x509 credentials are used +for negotiating the \s-1TLS\s0 session. The server will send its x509 certificate +to the client. It is recommended that a password be set on the \s-1VNC\s0 server +to provide authentication of the client when this is used. The path following +this option specifies where the x509 certificates are to be loaded from. +See the \fBvnc_security\fR section for details on generating certificates. +.IP "\fBx509verify=\fR\fI/path/to/certificate/dir\fR" 4 +.IX Item "x509verify=/path/to/certificate/dir" +Valid if \fBtls\fR is specified. Require that x509 credentials are used +for negotiating the \s-1TLS\s0 session. The server will send its x509 certificate +to the client, and request that the client send its own x509 certificate. +The server will validate the client's certificate against the \s-1CA\s0 certificate, +and reject clients when validation fails. If the certificate authority is +trusted, this is a sufficient authentication mechanism. You may still wish +to set a password on the \s-1VNC\s0 server as a second authentication layer. The +path following this option specifies where the x509 certificates are to +be loaded from. See the \fBvnc_security\fR section for details on generating +certificates. +.IP "\fBsasl\fR" 4 +.IX Item "sasl" +Require that the client use \s-1SASL\s0 to authenticate with the \s-1VNC\s0 server. +The exact choice of authentication method used is controlled from the +system / user's \s-1SASL\s0 configuration file for the 'qemu' service. This +is typically found in /etc/sasl2/qemu.conf. If running \s-1QEMU\s0 as an +unprivileged user, an environment variable \s-1SASL_CONF_PATH\s0 can be used +to make it search alternate locations for the service config. +While some \s-1SASL\s0 auth methods can also provide data encryption (eg \s-1GSSAPI\s0), +it is recommended that \s-1SASL\s0 always be combined with the 'tls' and +\&'x509' settings to enable use of \s-1SSL\s0 and server certificates. This +ensures a data encryption preventing compromise of authentication +credentials. See the \fBvnc_security\fR section for details on using +\&\s-1SASL\s0 authentication. +.IP "\fBacl\fR" 4 +.IX Item "acl" +Turn on access control lists for checking of the x509 client certificate +and \s-1SASL\s0 party. For x509 certs, the \s-1ACL\s0 check is made against the +certificate's distinguished name. This is something that looks like +\&\f(CW\*(C`C=GB,O=ACME,L=Boston,CN=bob\*(C'\fR. For \s-1SASL\s0 party, the \s-1ACL\s0 check is +made against the username, which depending on the \s-1SASL\s0 plugin, may +include a realm component, eg \f(CW\*(C`bob\*(C'\fR or \f(CW\*(C`bob@EXAMPLE.COM\*(C'\fR. +When the \fBacl\fR flag is set, the initial access list will be +empty, with a \f(CW\*(C`deny\*(C'\fR policy. Thus no one will be allowed to +use the \s-1VNC\s0 server until the ACLs have been loaded. This can be +achieved using the \f(CW\*(C`acl\*(C'\fR monitor command. +.IP "\fBlossy\fR" 4 +.IX Item "lossy" +Enable lossy compression methods (gradient, \s-1JPEG\s0, ...). If this +option is set, \s-1VNC\s0 client may receive lossy framebuffer updates +depending on its encoding settings. Enabling this option can save +a lot of bandwidth at the expense of quality. +.RE +.RS 4 +.RE +.PP +i386 target only: +.IP "\fB\-win2k\-hack\fR" 4 +.IX Item "-win2k-hack" +Use it when installing Windows 2000 to avoid a disk full bug. After +Windows 2000 is installed, you no longer need this option (this option +slows down the \s-1IDE\s0 transfers). +.IP "\fB\-no\-fd\-bootchk\fR" 4 +.IX Item "-no-fd-bootchk" +Disable boot signature checking for floppy disks in Bochs \s-1BIOS\s0. It may +be needed to boot from old floppy disks. +\&\s-1TODO:\s0 check reference to Bochs \s-1BIOS\s0. +.IP "\fB\-no\-acpi\fR" 4 +.IX Item "-no-acpi" +Disable \s-1ACPI\s0 (Advanced Configuration and Power Interface) support. Use +it if your guest \s-1OS\s0 complains about \s-1ACPI\s0 problems (\s-1PC\s0 target machine +only). +.IP "\fB\-no\-hpet\fR" 4 +.IX Item "-no-hpet" +Disable \s-1HPET\s0 support. +.IP "\fB\-balloon none\fR" 4 +.IX Item "-balloon none" +Disable balloon device. +.IP "\fB\-balloon virtio[,addr=\fR\fIaddr\fR\fB]\fR" 4 +.IX Item "-balloon virtio[,addr=addr]" +Enable virtio balloon device (default), optionally with \s-1PCI\s0 address +\&\fIaddr\fR. +.IP "\fB\-acpitable [sig=\fR\fIstr\fR\fB][,rev=\fR\fIn\fR\fB][,oem_id=\fR\fIstr\fR\fB][,oem_table_id=\fR\fIstr\fR\fB][,oem_rev=\fR\fIn\fR\fB] [,asl_compiler_id=\fR\fIstr\fR\fB][,asl_compiler_rev=\fR\fIn\fR\fB][,data=\fR\fIfile1\fR\fB[:\fR\fIfile2\fR\fB]...]\fR" 4 +.IX Item "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]" +Add \s-1ACPI\s0 table with specified header fields and context from specified files. +.IP "\fB\-smbios file=\fR\fIbinary\fR" 4 +.IX Item "-smbios file=binary" +Load \s-1SMBIOS\s0 entry from binary file. +.ie n .IP "\fB\-smbios type=0[,vendor=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,date=\fR\fIstr\fR\fB][,release=\fR\fI\fI%d\fI.%d\fR\fB]\fR" 4 +.el .IP "\fB\-smbios type=0[,vendor=\fR\fIstr\fR\fB][,version=\fR\fIstr\fR\fB][,date=\fR\fIstr\fR\fB][,release=\fR\fI\f(CI%d\fI.%d\fR\fB]\fR" 4 +.IX Item "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]" +Specify \s-1SMBIOS\s0 type 0 fields +.IP "\fB\-smbios type=1[,manufacturer=\fR\fIstr\fR\fB][,product=\fR\fIstr\fR\fB] [,version=\fR\fIstr\fR\fB][,serial=\fR\fIstr\fR\fB][,uuid=\fR\fIuuid\fR\fB][,sku=\fR\fIstr\fR\fB] [,family=\fR\fIstr\fR\fB]\fR" 4 +.IX Item "-smbios type=1[,manufacturer=str][,product=str] [,version=str][,serial=str][,uuid=uuid][,sku=str] [,family=str]" +Specify \s-1SMBIOS\s0 type 1 fields +.PP +Network options: +.IP "\fB\-net nic[,vlan=\fR\fIn\fR\fB][,macaddr=\fR\fImac\fR\fB][,model=\fR\fItype\fR\fB] [,name=\fR\fIname\fR\fB][,addr=\fR\fIaddr\fR\fB][,vectors=\fR\fIv\fR\fB]\fR" 4 +.IX Item "-net nic[,vlan=n][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]" +Create a new Network Interface Card and connect it to \s-1VLAN\s0 \fIn\fR (\fIn\fR += 0 is the default). The \s-1NIC\s0 is an e1000 by default on the \s-1PC\s0 +target. Optionally, the \s-1MAC\s0 address can be changed to \fImac\fR, the +device address set to \fIaddr\fR (\s-1PCI\s0 cards only), +and a \fIname\fR can be assigned for use in monitor commands. +Optionally, for \s-1PCI\s0 cards, you can specify the number \fIv\fR of MSI-X vectors +that the card should have; this option currently only affects virtio cards; set +\&\fIv\fR = 0 to disable MSI-X. If no \fB\-net\fR option is specified, a single +\&\s-1NIC\s0 is created. Qemu can emulate several different models of network card. +Valid values for \fItype\fR are +\&\f(CW\*(C`virtio\*(C'\fR, \f(CW\*(C`i82551\*(C'\fR, \f(CW\*(C`i82557b\*(C'\fR, \f(CW\*(C`i82559er\*(C'\fR, +\&\f(CW\*(C`ne2k_pci\*(C'\fR, \f(CW\*(C`ne2k_isa\*(C'\fR, \f(CW\*(C`pcnet\*(C'\fR, \f(CW\*(C`rtl8139\*(C'\fR, +\&\f(CW\*(C`e1000\*(C'\fR, \f(CW\*(C`smc91c111\*(C'\fR, \f(CW\*(C`lance\*(C'\fR and \f(CW\*(C`mcf_fec\*(C'\fR. +Not all devices are supported on all targets. Use \-net nic,model=? +for a list of available devices for your target. +.IP "\fB\-net user[,\fR\fIoption\fR\fB][,\fR\fIoption\fR\fB][,...]\fR" 4 +.IX Item "-net user[,option][,option][,...]" +Use the user mode network stack which requires no administrator +privilege to run. Valid options are: +.RS 4 +.IP "\fBvlan=\fR\fIn\fR" 4 +.IX Item "vlan=n" +Connect user mode stack to \s-1VLAN\s0 \fIn\fR (\fIn\fR = 0 is the default). +.IP "\fBname=\fR\fIname\fR" 4 +.IX Item "name=name" +Assign symbolic name for use in monitor commands. +.IP "\fBnet=\fR\fIaddr\fR\fB[/\fR\fImask\fR\fB]\fR" 4 +.IX Item "net=addr[/mask]" +Set \s-1IP\s0 network address the guest will see. Optionally specify the netmask, +either in the form a.b.c.d or as number of valid top-most bits. Default is +10.0.2.0/8. +.IP "\fBhost=\fR\fIaddr\fR" 4 +.IX Item "host=addr" +Specify the guest-visible address of the host. Default is the 2nd \s-1IP\s0 in the +guest network, i.e. x.x.x.2. +.IP "\fBrestrict=y|yes|n|no\fR" 4 +.IX Item "restrict=y|yes|n|no" +If this options is enabled, the guest will be isolated, i.e. it will not be +able to contact the host and no guest \s-1IP\s0 packets will be routed over the host +to the outside. This option does not affect explicitly set forwarding rule. +.IP "\fBhostname=\fR\fIname\fR" 4 +.IX Item "hostname=name" +Specifies the client hostname reported by the builtin \s-1DHCP\s0 server. +.IP "\fBdhcpstart=\fR\fIaddr\fR" 4 +.IX Item "dhcpstart=addr" +Specify the first of the 16 IPs the built-in \s-1DHCP\s0 server can assign. Default +is the 16th to 31st \s-1IP\s0 in the guest network, i.e. x.x.x.16 to x.x.x.31. +.IP "\fBdns=\fR\fIaddr\fR" 4 +.IX Item "dns=addr" +Specify the guest-visible address of the virtual nameserver. The address must +be different from the host address. Default is the 3rd \s-1IP\s0 in the guest network, +i.e. x.x.x.3. +.IP "\fBtftp=\fR\fIdir\fR" 4 +.IX Item "tftp=dir" +When using the user mode network stack, activate a built-in \s-1TFTP\s0 +server. The files in \fIdir\fR will be exposed as the root of a \s-1TFTP\s0 server. +The \s-1TFTP\s0 client on the guest must be configured in binary mode (use the command +\&\f(CW\*(C`bin\*(C'\fR of the Unix \s-1TFTP\s0 client). +.IP "\fBbootfile=\fR\fIfile\fR" 4 +.IX Item "bootfile=file" +When using the user mode network stack, broadcast \fIfile\fR as the \s-1BOOTP\s0 +filename. In conjunction with \fBtftp\fR, this can be used to network boot +a guest from a local directory. +.Sp +Example (using pxelinux): +.Sp +.Vb 1 +\& qemu \-hda linux.img \-boot n \-net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 +.Ve +.IP "\fBsmb=\fR\fIdir\fR\fB[,smbserver=\fR\fIaddr\fR\fB]\fR" 4 +.IX Item "smb=dir[,smbserver=addr]" +When using the user mode network stack, activate a built-in \s-1SMB\s0 +server so that Windows OSes can access to the host files in \fI\fIdir\fI\fR +transparently. The \s-1IP\s0 address of the \s-1SMB\s0 server can be set to \fIaddr\fR. By +default the 4th \s-1IP\s0 in the guest network is used, i.e. x.x.x.4. +.Sp +In the guest Windows \s-1OS\s0, the line: +.Sp +.Vb 1 +\& 10.0.2.4 smbserver +.Ve +.Sp +must be added in the file \fIC:\eWINDOWS\eLMHOSTS\fR (for windows 9x/Me) +or \fIC:\eWINNT\eSYSTEM32\eDRIVERS\eETC\eLMHOSTS\fR (Windows \s-1NT/2000\s0). +.Sp +Then \fI\fIdir\fI\fR can be accessed in \fI\e\esmbserver\eqemu\fR. +.Sp +Note that a \s-1SAMBA\s0 server must be installed on the host \s-1OS\s0 in +\&\fI/usr/sbin/smbd\fR. \s-1QEMU\s0 was tested successfully with smbd versions from +Red Hat 9, Fedora Core 3 and OpenSUSE 11.x. +.IP "\fBhostfwd=[tcp|udp]:[\fR\fIhostaddr\fR\fB]:\fR\fIhostport\fR\fB\-[\fR\fIguestaddr\fR\fB]:\fR\fIguestport\fR" 4 +.IX Item "hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport" +Redirect incoming \s-1TCP\s0 or \s-1UDP\s0 connections to the host port \fIhostport\fR to +the guest \s-1IP\s0 address \fIguestaddr\fR on guest port \fIguestport\fR. If +\&\fIguestaddr\fR is not specified, its value is x.x.x.15 (default first address +given by the built-in \s-1DHCP\s0 server). By specifying \fIhostaddr\fR, the rule can +be bound to a specific host interface. If no connection type is set, \s-1TCP\s0 is +used. This option can be given multiple times. +.Sp +For example, to redirect host X11 connection from screen 1 to guest +screen 0, use the following: +.Sp +.Vb 4 +\& # on the host +\& qemu \-net user,hostfwd=tcp:127.0.0.1:6001\-:6000 [...] +\& # this host xterm should open in the guest X11 server +\& xterm \-display :1 +.Ve +.Sp +To redirect telnet connections from host port 5555 to telnet port on +the guest, use the following: +.Sp +.Vb 3 +\& # on the host +\& qemu \-net user,hostfwd=tcp::5555\-:23 [...] +\& telnet localhost 5555 +.Ve +.Sp +Then when you use on the host \f(CW\*(C`telnet localhost 5555\*(C'\fR, you +connect to the guest telnet server. +.IP "\fBguestfwd=[tcp]:\fR\fIserver\fR\fB:\fR\fIport\fR\fB\-\fR\fIdev\fR" 4 +.IX Item "guestfwd=[tcp]:server:port-dev" +Forward guest \s-1TCP\s0 connections to the \s-1IP\s0 address \fIserver\fR on port \fIport\fR +to the character device \fIdev\fR. This option can be given multiple times. +.RE +.RS 4 +.Sp +Note: Legacy stand-alone options \-tftp, \-bootp, \-smb and \-redir are still +processed and applied to \-net user. Mixing them with the new configuration +syntax gives undefined results. Their use for new applications is discouraged +as they will be removed from future versions. +.RE +.IP "\fB\-net tap[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\fR\fB][,fd=\fR\fIh\fR\fB][,ifname=\fR\fIname\fR\fB] [,script=\fR\fIfile\fR\fB][,downscript=\fR\fIdfile\fR\fB]\fR" 4 +.IX Item "-net tap[,vlan=n][,name=name][,fd=h][,ifname=name] [,script=file][,downscript=dfile]" +Connect the host \s-1TAP\s0 network interface \fIname\fR to \s-1VLAN\s0 \fIn\fR, use +the network script \fIfile\fR to configure it and the network script +\&\fIdfile\fR to deconfigure it. If \fIname\fR is not provided, the \s-1OS\s0 +automatically provides one. \fBfd\fR=\fIh\fR can be used to specify +the handle of an already opened host \s-1TAP\s0 interface. The default network +configure script is \fI/etc/qemu\-ifup\fR and the default network +deconfigure script is \fI/etc/qemu\-ifdown\fR. Use \fBscript=no\fR +or \fBdownscript=no\fR to disable script execution. Example: +.Sp +.Vb 1 +\& qemu linux.img \-net nic \-net tap +.Ve +.Sp +More complicated example (two NICs, each one connected to a \s-1TAP\s0 device) +.Sp +.Vb 2 +\& qemu linux.img \-net nic,vlan=0 \-net tap,vlan=0,ifname=tap0 \e +\& \-net nic,vlan=1 \-net tap,vlan=1,ifname=tap1 +.Ve +.IP "\fB\-net socket[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\fR\fB][,fd=\fR\fIh\fR\fB] [,listen=[\fR\fIhost\fR\fB]:\fR\fIport\fR\fB][,connect=\fR\fIhost\fR\fB:\fR\fIport\fR\fB]\fR" 4 +.IX Item "-net socket[,vlan=n][,name=name][,fd=h] [,listen=[host]:port][,connect=host:port]" +Connect the \s-1VLAN\s0 \fIn\fR to a remote \s-1VLAN\s0 in another \s-1QEMU\s0 virtual +machine using a \s-1TCP\s0 socket connection. If \fBlisten\fR is +specified, \s-1QEMU\s0 waits for incoming connections on \fIport\fR +(\fIhost\fR is optional). \fBconnect\fR is used to connect to +another \s-1QEMU\s0 instance using the \fBlisten\fR option. \fBfd\fR=\fIh\fR +specifies an already opened \s-1TCP\s0 socket. +.Sp +Example: +.Sp +.Vb 7 +\& # launch a first QEMU instance +\& qemu linux.img \-net nic,macaddr=52:54:00:12:34:56 \e +\& \-net socket,listen=:1234 +\& # connect the VLAN 0 of this instance to the VLAN 0 +\& # of the first instance +\& qemu linux.img \-net nic,macaddr=52:54:00:12:34:57 \e +\& \-net socket,connect=127.0.0.1:1234 +.Ve +.IP "\fB\-net socket[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\fR\fB][,fd=\fR\fIh\fR\fB] [,mcast=\fR\fImaddr\fR\fB:\fR\fIport\fR\fB]\fR" 4 +.IX Item "-net socket[,vlan=n][,name=name][,fd=h] [,mcast=maddr:port]" +Create a \s-1VLAN\s0 \fIn\fR shared with another \s-1QEMU\s0 virtual +machines using a \s-1UDP\s0 multicast socket, effectively making a bus for +every \s-1QEMU\s0 with same multicast address \fImaddr\fR and \fIport\fR. +\&\s-1NOTES:\s0 +.RS 4 +.IP "1." 4 +Several \s-1QEMU\s0 can be running on different hosts and share same bus (assuming +correct multicast setup for these hosts). +.IP "2." 4 +mcast support is compatible with User Mode Linux (argument \fBeth\fR\fIN\fR\fB=mcast\fR), see +<\fBhttp://user\-mode\-linux.sf.net\fR>. +.IP "3." 4 +Use \fBfd=h\fR to specify an already opened \s-1UDP\s0 multicast socket. +.RE +.RS 4 +.Sp +Example: +.Sp +.Vb 9 +\& # launch one QEMU instance +\& qemu linux.img \-net nic,macaddr=52:54:00:12:34:56 \e +\& \-net socket,mcast=230.0.0.1:1234 +\& # launch another QEMU instance on same "bus" +\& qemu linux.img \-net nic,macaddr=52:54:00:12:34:57 \e +\& \-net socket,mcast=230.0.0.1:1234 +\& # launch yet another QEMU instance on same "bus" +\& qemu linux.img \-net nic,macaddr=52:54:00:12:34:58 \e +\& \-net socket,mcast=230.0.0.1:1234 +.Ve +.Sp +Example (User Mode Linux compat.): +.Sp +.Vb 6 +\& # launch QEMU instance (note mcast address selected +\& # is UML\*(Aqs default) +\& qemu linux.img \-net nic,macaddr=52:54:00:12:34:56 \e +\& \-net socket,mcast=239.192.168.1:1102 +\& # launch UML +\& /path/to/linux ubd0=/path/to/root_fs eth0=mcast +.Ve +.RE +.IP "\fB\-net vde[,vlan=\fR\fIn\fR\fB][,name=\fR\fIname\fR\fB][,sock=\fR\fIsocketpath\fR\fB] [,port=\fR\fIn\fR\fB][,group=\fR\fIgroupname\fR\fB][,mode=\fR\fIoctalmode\fR\fB]\fR" 4 +.IX Item "-net vde[,vlan=n][,name=name][,sock=socketpath] [,port=n][,group=groupname][,mode=octalmode]" +Connect \s-1VLAN\s0 \fIn\fR to \s-1PORT\s0 \fIn\fR of a vde switch running on host and +listening for incoming connections on \fIsocketpath\fR. Use \s-1GROUP\s0 \fIgroupname\fR +and \s-1MODE\s0 \fIoctalmode\fR to change default ownership and permissions for +communication port. This option is available only if \s-1QEMU\s0 has been compiled +with vde support enabled. +.Sp +Example: +.Sp +.Vb 4 +\& # launch vde switch +\& vde_switch \-F \-sock /tmp/myswitch +\& # launch QEMU instance +\& qemu linux.img \-net nic \-net vde,sock=/tmp/myswitch +.Ve +.IP "\fB\-net dump[,vlan=\fR\fIn\fR\fB][,file=\fR\fIfile\fR\fB][,len=\fR\fIlen\fR\fB]\fR" 4 +.IX Item "-net dump[,vlan=n][,file=file][,len=len]" +Dump network traffic on \s-1VLAN\s0 \fIn\fR to file \fIfile\fR (\fIqemu\-vlan0.pcap\fR by default). +At most \fIlen\fR bytes (64k by default) per packet are stored. The file format is +libpcap, so it can be analyzed with tools such as tcpdump or Wireshark. +.IP "\fB\-net none\fR" 4 +.IX Item "-net none" +Indicate that no network devices should be configured. It is used to +override the default configuration (\fB\-net nic \-net user\fR) which +is activated if no \fB\-net\fR options are provided. +.PP +Character device options: +.PP +The general form of a character device option is: +.IP "\fB\-chardev\fR \fIbackend\fR \fB,id=\fR\fIid\fR \fB[,mux=on|off] [,\fR\fIoptions\fR\fB]\fR" 4 +.IX Item "-chardev backend ,id=id [,mux=on|off] [,options]" +Backend is one of: +\&\fBnull\fR, +\&\fBsocket\fR, +\&\fBudp\fR, +\&\fBmsmouse\fR, +\&\fBvc\fR, +\&\fBfile\fR, +\&\fBpipe\fR, +\&\fBconsole\fR, +\&\fBserial\fR, +\&\fBpty\fR, +\&\fBstdio\fR, +\&\fBbraille\fR, +\&\fBtty\fR, +\&\fBparport\fR. +The specific backend will determine the applicable options. +.Sp +All devices must have an id, which can be any string up to 127 characters long. +It is used to uniquely identify this device in other command line directives. +.Sp +A character device may be used in multiplexing mode by multiple front-ends. +The key sequence of \fBControl-a\fR and \fBc\fR will rotate the input focus +between attached front-ends. Specify \fBmux=on\fR to enable this mode. +.Sp +Options to each backend are described below. +.IP "\fB\-chardev null ,id=\fR\fIid\fR" 4 +.IX Item "-chardev null ,id=id" +A void device. This device will not emit any data, and will drop any data it +receives. The null backend does not take any options. +.IP "\fB\-chardev socket ,id=\fR\fIid\fR \fB[\fR\fI\s-1TCP\s0 options\fR \fBor\fR \fIunix options\fR\fB] [,server] [,nowait] [,telnet]\fR" 4 +.IX Item "-chardev socket ,id=id [TCP options or unix options] [,server] [,nowait] [,telnet]" +Create a two-way stream socket, which can be either a \s-1TCP\s0 or a unix socket. A +unix socket will be created if \fBpath\fR is specified. Behaviour is +undefined if \s-1TCP\s0 options are specified for a unix socket. +.Sp +\&\fBserver\fR specifies that the socket shall be a listening socket. +.Sp +\&\fBnowait\fR specifies that \s-1QEMU\s0 should not block waiting for a client to +connect to a listening socket. +.Sp +\&\fBtelnet\fR specifies that traffic on the socket should interpret telnet +escape sequences. +.Sp +\&\s-1TCP\s0 and unix socket options are given below: +.RS 4 +.IP "\fB\s-1TCP\s0 options: port=\fR\fIport\fR \fB[,host=\fR\fIhost\fR\fB] [,to=\fR\fIto\fR\fB] [,ipv4] [,ipv6] [,nodelay]\fR" 4 +.IX Item "TCP options: port=port [,host=host] [,to=to] [,ipv4] [,ipv6] [,nodelay]" +\&\fBhost\fR for a listening socket specifies the local address to be bound. +For a connecting socket species the remote host to connect to. \fBhost\fR is +optional for listening sockets. If not specified it defaults to \f(CW0.0.0.0\fR. +.Sp +\&\fBport\fR for a listening socket specifies the local port to be bound. For a +connecting socket specifies the port on the remote host to connect to. +\&\fBport\fR can be given as either a port number or a service name. +\&\fBport\fR is required. +.Sp +\&\fBto\fR is only relevant to listening sockets. If it is specified, and +\&\fBport\fR cannot be bound, \s-1QEMU\s0 will attempt to bind to subsequent ports up +to and including \fBto\fR until it succeeds. \fBto\fR must be specified +as a port number. +.Sp +\&\fBipv4\fR and \fBipv6\fR specify that either IPv4 or IPv6 must be used. +If neither is specified the socket may use either protocol. +.Sp +\&\fBnodelay\fR disables the Nagle algorithm. +.IP "\fBunix options: path=\fR\fIpath\fR" 4 +.IX Item "unix options: path=path" +\&\fBpath\fR specifies the local path of the unix socket. \fBpath\fR is +required. +.RE +.RS 4 +.RE +.IP "\fB\-chardev udp ,id=\fR\fIid\fR \fB[,host=\fR\fIhost\fR\fB] ,port=\fR\fIport\fR \fB[,localaddr=\fR\fIlocaladdr\fR\fB] [,localport=\fR\fIlocalport\fR\fB] [,ipv4] [,ipv6]\fR" 4 +.IX Item "-chardev udp ,id=id [,host=host] ,port=port [,localaddr=localaddr] [,localport=localport] [,ipv4] [,ipv6]" +Sends all traffic from the guest to a remote host over \s-1UDP\s0. +.Sp +\&\fBhost\fR specifies the remote host to connect to. If not specified it +defaults to \f(CW\*(C`localhost\*(C'\fR. +.Sp +\&\fBport\fR specifies the port on the remote host to connect to. \fBport\fR +is required. +.Sp +\&\fBlocaladdr\fR specifies the local address to bind to. If not specified it +defaults to \f(CW0.0.0.0\fR. +.Sp +\&\fBlocalport\fR specifies the local port to bind to. If not specified any +available local port will be used. +.Sp +\&\fBipv4\fR and \fBipv6\fR specify that either IPv4 or IPv6 must be used. +If neither is specified the device may use either protocol. +.IP "\fB\-chardev msmouse ,id=\fR\fIid\fR" 4 +.IX Item "-chardev msmouse ,id=id" +Forward \s-1QEMU\s0's emulated msmouse events to the guest. \fBmsmouse\fR does not +take any options. +.IP "\fB\-chardev vc ,id=\fR\fIid\fR \fB[[,width=\fR\fIwidth\fR\fB] [,height=\fR\fIheight\fR\fB]] [[,cols=\fR\fIcols\fR\fB] [,rows=\fR\fIrows\fR\fB]]\fR" 4 +.IX Item "-chardev vc ,id=id [[,width=width] [,height=height]] [[,cols=cols] [,rows=rows]]" +Connect to a \s-1QEMU\s0 text console. \fBvc\fR may optionally be given a specific +size. +.Sp +\&\fBwidth\fR and \fBheight\fR specify the width and height respectively of +the console, in pixels. +.Sp +\&\fBcols\fR and \fBrows\fR specify that the console be sized to fit a text +console with the given dimensions. +.IP "\fB\-chardev file ,id=\fR\fIid\fR \fB,path=\fR\fIpath\fR" 4 +.IX Item "-chardev file ,id=id ,path=path" +Log all traffic received from the guest to a file. +.Sp +\&\fBpath\fR specifies the path of the file to be opened. This file will be +created if it does not already exist, and overwritten if it does. \fBpath\fR +is required. +.IP "\fB\-chardev pipe ,id=\fR\fIid\fR \fB,path=\fR\fIpath\fR" 4 +.IX Item "-chardev pipe ,id=id ,path=path" +Create a two-way connection to the guest. The behaviour differs slightly between +Windows hosts and other hosts: +.Sp +On Windows, a single duplex pipe will be created at +\&\fI\e\e.pipe\e\f(BIpath\fI\fR. +.Sp +On other hosts, 2 pipes will be created called \fI\f(BIpath\fI.in\fR and +\&\fI\f(BIpath\fI.out\fR. Data written to \fI\f(BIpath\fI.in\fR will be +received by the guest. Data written by the guest can be read from +\&\fI\f(BIpath\fI.out\fR. \s-1QEMU\s0 will not create these fifos, and requires them to +be present. +.Sp +\&\fBpath\fR forms part of the pipe path as described above. \fBpath\fR is +required. +.IP "\fB\-chardev console ,id=\fR\fIid\fR" 4 +.IX Item "-chardev console ,id=id" +Send traffic from the guest to \s-1QEMU\s0's standard output. \fBconsole\fR does not +take any options. +.Sp +\&\fBconsole\fR is only available on Windows hosts. +.IP "\fB\-chardev serial ,id=\fR\fIid\fR \fB,path=\fR\fBpath\fR" 4 +.IX Item "-chardev serial ,id=id ,path=path" +Send traffic from the guest to a serial device on the host. +.Sp +\&\fBserial\fR is +only available on Windows hosts. +.Sp +\&\fBpath\fR specifies the name of the serial device to open. +.IP "\fB\-chardev pty ,id=\fR\fIid\fR" 4 +.IX Item "-chardev pty ,id=id" +Create a new pseudo-terminal on the host and connect to it. \fBpty\fR does +not take any options. +.Sp +\&\fBpty\fR is not available on Windows hosts. +.IP "\fB\-chardev stdio ,id=\fR\fIid\fR \fB[,signal=on|off]\fR" 4 +.IX Item "-chardev stdio ,id=id [,signal=on|off]" +Connect to standard input and standard output of the qemu process. +.Sp +\&\fBsignal\fR controls if signals are enabled on the terminal, that includes +exiting \s-1QEMU\s0 with the key sequence \fBControl-c\fR. This option is enabled by +default, use \fBsignal=off\fR to disable it. +.Sp +\&\fBstdio\fR is not available on Windows hosts. +.IP "\fB\-chardev braille ,id=\fR\fIid\fR" 4 +.IX Item "-chardev braille ,id=id" +Connect to a local BrlAPI server. \fBbraille\fR does not take any options. +.IP "\fB\-chardev tty ,id=\fR\fIid\fR \fB,path=\fR\fIpath\fR" 4 +.IX Item "-chardev tty ,id=id ,path=path" +Connect to a local tty device. +.Sp +\&\fBtty\fR is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and +DragonFlyBSD hosts. +.Sp +\&\fBpath\fR specifies the path to the tty. \fBpath\fR is required. +.IP "\fB\-chardev parport ,id=\fR\fIid\fR \fB,path=\fR\fIpath\fR" 4 +.IX Item "-chardev parport ,id=id ,path=path" +\&\fBparport\fR is only available on Linux, FreeBSD and DragonFlyBSD hosts. +.Sp +Connect to a local parallel port. +.Sp +\&\fBpath\fR specifies the path to the parallel port device. \fBpath\fR is +required. +.PP +Bluetooth(R) options: +.IP "\fB\-bt hci[...]\fR" 4 +.IX Item "-bt hci[...]" +Defines the function of the corresponding Bluetooth \s-1HCI\s0. \-bt options +are matched with the HCIs present in the chosen machine type. For +example when emulating a machine with only one \s-1HCI\s0 built into it, only +the first \f(CW\*(C`\-bt hci[...]\*(C'\fR option is valid and defines the \s-1HCI\s0's +logic. The Transport Layer is decided by the machine type. Currently +the machines \f(CW\*(C`n800\*(C'\fR and \f(CW\*(C`n810\*(C'\fR have one \s-1HCI\s0 and all other +machines have none. +.Sp +The following three types are recognized: +.RS 4 +.IP "\fB\-bt hci,null\fR" 4 +.IX Item "-bt hci,null" +(default) The corresponding Bluetooth \s-1HCI\s0 assumes no internal logic +and will not respond to any \s-1HCI\s0 commands or emit events. +.IP "\fB\-bt hci,host[:\fR\fIid\fR\fB]\fR" 4 +.IX Item "-bt hci,host[:id]" +(\f(CW\*(C`bluez\*(C'\fR only) The corresponding \s-1HCI\s0 passes commands / events +to / from the physical \s-1HCI\s0 identified by the name \fIid\fR (default: +\&\f(CW\*(C`hci0\*(C'\fR) on the computer running \s-1QEMU\s0. Only available on \f(CW\*(C`bluez\*(C'\fR +capable systems like Linux. +.IP "\fB\-bt hci[,vlan=\fR\fIn\fR\fB]\fR" 4 +.IX Item "-bt hci[,vlan=n]" +Add a virtual, standard \s-1HCI\s0 that will participate in the Bluetooth +scatternet \fIn\fR (default \f(CW0\fR). Similarly to \fB\-net\fR +VLANs, devices inside a bluetooth network \fIn\fR can only communicate +with other devices in the same network (scatternet). +.RE +.RS 4 +.RE +.IP "\fB\-bt vhci[,vlan=\fR\fIn\fR\fB]\fR" 4 +.IX Item "-bt vhci[,vlan=n]" +(Linux-host only) Create a \s-1HCI\s0 in scatternet \fIn\fR (default 0) attached +to the host bluetooth stack instead of to the emulated target. This +allows the host and target machines to participate in a common scatternet +and communicate. Requires the Linux \f(CW\*(C`vhci\*(C'\fR driver installed. Can +be used as following: +.Sp +.Vb 1 +\& qemu [...OPTIONS...] \-bt hci,vlan=5 \-bt vhci,vlan=5 +.Ve +.IP "\fB\-bt device:\fR\fIdev\fR\fB[,vlan=\fR\fIn\fR\fB]\fR" 4 +.IX Item "-bt device:dev[,vlan=n]" +Emulate a bluetooth device \fIdev\fR and place it in network \fIn\fR +(default \f(CW0\fR). \s-1QEMU\s0 can only emulate one type of bluetooth devices +currently: +.RS 4 +.IP "\fBkeyboard\fR" 4 +.IX Item "keyboard" +Virtual wireless keyboard implementing the \s-1HIDP\s0 bluetooth profile. +.RE +.RS 4 +.RE +.PP +Linux/Multiboot boot specific: +.PP +When using these options, you can use a given Linux or Multiboot +kernel without installing it in the disk image. It can be useful +for easier testing of various kernels. +.IP "\fB\-kernel\fR \fIbzImage\fR" 4 +.IX Item "-kernel bzImage" +Use \fIbzImage\fR as kernel image. The kernel can be either a Linux kernel +or in multiboot format. +.IP "\fB\-append\fR \fIcmdline\fR" 4 +.IX Item "-append cmdline" +Use \fIcmdline\fR as kernel command line +.IP "\fB\-initrd\fR \fIfile\fR" 4 +.IX Item "-initrd file" +Use \fIfile\fR as initial ram disk. +.ie n .IP "\fB\-initrd ""\fR\fIfile1\fR \fBarg=foo,\fR\fIfile2\fR\fB""\fR" 4 +.el .IP "\fB\-initrd ``\fR\fIfile1\fR \fBarg=foo,\fR\fIfile2\fR\fB''\fR" 4 +.IX Item "-initrd ""file1 arg=foo,file2""" +This syntax is only available with multiboot. +.Sp +Use \fIfile1\fR and \fIfile2\fR as modules and pass arg=foo as parameter to the +first module. +.PP +Debug/Expert options: +.IP "\fB\-serial\fR \fIdev\fR" 4 +.IX Item "-serial dev" +Redirect the virtual serial port to host character device +\&\fIdev\fR. The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and +\&\f(CW\*(C`stdio\*(C'\fR in non graphical mode. +.Sp +This option can be used several times to simulate up to 4 serial +ports. +.Sp +Use \f(CW\*(C`\-serial none\*(C'\fR to disable all serial ports. +.Sp +Available character devices are: +.RS 4 +.IP "\fBvc[:\fR\fIW\fR\fBx\fR\fIH\fR\fB]\fR" 4 +.IX Item "vc[:WxH]" +Virtual console. Optionally, a width and height can be given in pixel with +.Sp +.Vb 1 +\& vc:800x600 +.Ve +.Sp +It is also possible to specify width or height in characters: +.Sp +.Vb 1 +\& vc:80Cx24C +.Ve +.IP "\fBpty\fR" 4 +.IX Item "pty" +[Linux only] Pseudo \s-1TTY\s0 (a new \s-1PTY\s0 is automatically allocated) +.IP "\fBnone\fR" 4 +.IX Item "none" +No device is allocated. +.IP "\fBnull\fR" 4 +.IX Item "null" +void device +.IP "\fB/dev/XXX\fR" 4 +.IX Item "/dev/XXX" +[Linux only] Use host tty, e.g. \fI/dev/ttyS0\fR. The host serial port +parameters are set according to the emulated ones. +.IP "\fB/dev/parport\fR\fIN\fR" 4 +.IX Item "/dev/parportN" +[Linux only, parallel port only] Use host parallel port +\&\fIN\fR. Currently \s-1SPP\s0 and \s-1EPP\s0 parallel port features can be used. +.IP "\fBfile:\fR\fIfilename\fR" 4 +.IX Item "file:filename" +Write output to \fIfilename\fR. No character can be read. +.IP "\fBstdio\fR" 4 +.IX Item "stdio" +[Unix only] standard input/output +.IP "\fBpipe:\fR\fIfilename\fR" 4 +.IX Item "pipe:filename" +name pipe \fIfilename\fR +.IP "\fB\s-1COM\s0\fR\fIn\fR" 4 +.IX Item "COMn" +[Windows only] Use host serial port \fIn\fR +.IP "\fBudp:[\fR\fIremote_host\fR\fB]:\fR\fIremote_port\fR\fB[@[\fR\fIsrc_ip\fR\fB]:\fR\fIsrc_port\fR\fB]\fR" 4 +.IX Item "udp:[remote_host]:remote_port[@[src_ip]:src_port]" +This implements \s-1UDP\s0 Net Console. +When \fIremote_host\fR or \fIsrc_ip\fR are not specified +they default to \f(CW0.0.0.0\fR. +When not using a specified \fIsrc_port\fR a random port is automatically chosen. +.Sp +If you just want a simple readonly console you can use \f(CW\*(C`netcat\*(C'\fR or +\&\f(CW\*(C`nc\*(C'\fR, by starting qemu with: \f(CW\*(C`\-serial udp::4555\*(C'\fR and nc as: +\&\f(CW\*(C`nc \-u \-l \-p 4555\*(C'\fR. Any time qemu writes something to that port it +will appear in the netconsole session. +.Sp +If you plan to send characters back via netconsole or you want to stop +and start qemu a lot of times, you should have qemu use the same +source port each time by using something like \f(CW\*(C`\-serial +udp::4555@4556\*(C'\fR to qemu. Another approach is to use a patched +version of netcat which can listen to a \s-1TCP\s0 port and send and receive +characters via udp. If you have a patched version of netcat which +activates telnet remote echo and single char transfer, then you can +use the following options to step up a netcat redirector to allow +telnet on port 5555 to access the qemu port. +.RS 4 +.ie n .IP """Qemu Options:""" 4 +.el .IP "\f(CWQemu Options:\fR" 4 +.IX Item "Qemu Options:" +\&\-serial udp::4555@4556 +.ie n .IP """netcat options:""" 4 +.el .IP "\f(CWnetcat options:\fR" 4 +.IX Item "netcat options:" +\&\-u \-P 4555 \-L 0.0.0.0:4556 \-t \-p 5555 \-I \-T +.ie n .IP """telnet options:""" 4 +.el .IP "\f(CWtelnet options:\fR" 4 +.IX Item "telnet options:" +localhost 5555 +.RE +.RS 4 +.RE +.IP "\fBtcp:[\fR\fIhost\fR\fB]:\fR\fIport\fR\fB[,\fR\fIserver\fR\fB][,nowait][,nodelay]\fR" 4 +.IX Item "tcp:[host]:port[,server][,nowait][,nodelay]" +The \s-1TCP\s0 Net Console has two modes of operation. It can send the serial +I/O to a location or wait for a connection from a location. By default +the \s-1TCP\s0 Net Console is sent to \fIhost\fR at the \fIport\fR. If you use +the \fIserver\fR option \s-1QEMU\s0 will wait for a client socket application +to connect to the port before continuing, unless the \f(CW\*(C`nowait\*(C'\fR +option was specified. The \f(CW\*(C`nodelay\*(C'\fR option disables the Nagle buffering +algorithm. If \fIhost\fR is omitted, 0.0.0.0 is assumed. Only +one \s-1TCP\s0 connection at a time is accepted. You can use \f(CW\*(C`telnet\*(C'\fR to +connect to the corresponding character device. +.RS 4 +.ie n .IP """Example to send tcp console to 192.168.0.2 port 4444""" 4 +.el .IP "\f(CWExample to send tcp console to 192.168.0.2 port 4444\fR" 4 +.IX Item "Example to send tcp console to 192.168.0.2 port 4444" +\&\-serial tcp:192.168.0.2:4444 +.ie n .IP """Example to listen and wait on port 4444 for connection""" 4 +.el .IP "\f(CWExample to listen and wait on port 4444 for connection\fR" 4 +.IX Item "Example to listen and wait on port 4444 for connection" +\&\-serial tcp::4444,server +.ie n .IP """Example to not wait and listen on ip 192.168.0.100 port 4444""" 4 +.el .IP "\f(CWExample to not wait and listen on ip 192.168.0.100 port 4444\fR" 4 +.IX Item "Example to not wait and listen on ip 192.168.0.100 port 4444" +\&\-serial tcp:192.168.0.100:4444,server,nowait +.RE +.RS 4 +.RE +.IP "\fBtelnet:\fR\fIhost\fR\fB:\fR\fIport\fR\fB[,server][,nowait][,nodelay]\fR" 4 +.IX Item "telnet:host:port[,server][,nowait][,nodelay]" +The telnet protocol is used instead of raw tcp sockets. The options +work the same as if you had specified \f(CW\*(C`\-serial tcp\*(C'\fR. The +difference is that the port acts like a telnet server or client using +telnet option negotiation. This will also allow you to send the +\&\s-1MAGIC_SYSRQ\s0 sequence if you use a telnet that supports sending the break +sequence. Typically in unix telnet you do it with Control\-] and then +type \*(L"send break\*(R" followed by pressing the enter key. +.IP "\fBunix:\fR\fIpath\fR\fB[,server][,nowait]\fR" 4 +.IX Item "unix:path[,server][,nowait]" +A unix domain socket is used instead of a tcp socket. The option works the +same as if you had specified \f(CW\*(C`\-serial tcp\*(C'\fR except the unix domain socket +\&\fIpath\fR is used for connections. +.IP "\fBmon:\fR\fIdev_string\fR" 4 +.IX Item "mon:dev_string" +This is a special option to allow the monitor to be multiplexed onto +another serial port. The monitor is accessed with key sequence of +\&\fBControl-a\fR and then pressing \fBc\fR. See monitor access +\&\fBpcsys_keys\fR in the \-nographic section for more keys. +\&\fIdev_string\fR should be any one of the serial devices specified +above. An example to multiplex the monitor onto a telnet server +listening on port 4444 would be: +.RS 4 +.ie n .IP """\-serial mon:telnet::4444,server,nowait""" 4 +.el .IP "\f(CW\-serial mon:telnet::4444,server,nowait\fR" 4 +.IX Item "-serial mon:telnet::4444,server,nowait" +.RE +.RS 4 +.RE +.PD 0 +.IP "\fBbraille\fR" 4 +.IX Item "braille" +.PD +Braille device. This will use BrlAPI to display the braille output on a real +or fake device. +.IP "\fBmsmouse\fR" 4 +.IX Item "msmouse" +Three button serial mouse. Configure the guest to use Microsoft protocol. +.RE +.RS 4 +.RE +.IP "\fB\-parallel\fR \fIdev\fR" 4 +.IX Item "-parallel dev" +Redirect the virtual parallel port to host device \fIdev\fR (same +devices as the serial port). On Linux hosts, \fI/dev/parportN\fR can +be used to use hardware devices connected on the corresponding host +parallel port. +.Sp +This option can be used several times to simulate up to 3 parallel +ports. +.Sp +Use \f(CW\*(C`\-parallel none\*(C'\fR to disable all parallel ports. +.IP "\fB\-monitor\fR \fIdev\fR" 4 +.IX Item "-monitor dev" +Redirect the monitor to host device \fIdev\fR (same devices as the +serial port). +The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \f(CW\*(C`stdio\*(C'\fR in +non graphical mode. +.IP "\fB\-qmp\fR \fIdev\fR" 4 +.IX Item "-qmp dev" +Like \-monitor but opens in 'control' mode. +.IP "\fB\-mon chardev=[name][,mode=readline|control][,default]\fR" 4 +.IX Item "-mon chardev=[name][,mode=readline|control][,default]" +Setup monitor on chardev \fIname\fR. +.IP "\fB\-debugcon\fR \fIdev\fR" 4 +.IX Item "-debugcon dev" +Redirect the debug console to host device \fIdev\fR (same devices as the +serial port). The debug console is an I/O port which is typically port +0xe9; writing to that I/O port sends output to this device. +The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \f(CW\*(C`stdio\*(C'\fR in +non graphical mode. +.IP "\fB\-pidfile\fR \fIfile\fR" 4 +.IX Item "-pidfile file" +Store the \s-1QEMU\s0 process \s-1PID\s0 in \fIfile\fR. It is useful if you launch \s-1QEMU\s0 +from a script. +.IP "\fB\-singlestep\fR" 4 +.IX Item "-singlestep" +Run the emulation in single step mode. +.IP "\fB\-S\fR" 4 +.IX Item "-S" +Do not start \s-1CPU\s0 at startup (you must type 'c' in the monitor). +.IP "\fB\-gdb\fR \fIdev\fR" 4 +.IX Item "-gdb dev" +Wait for gdb connection on device \fIdev\fR. Typical +connections will likely be TCP-based, but also \s-1UDP\s0, pseudo \s-1TTY\s0, or even +stdio are reasonable use case. The latter is allowing to start qemu from +within gdb and establish the connection via a pipe: +.Sp +.Vb 1 +\& (gdb) target remote | exec qemu \-gdb stdio ... +.Ve +.IP "\fB\-s\fR" 4 +.IX Item "-s" +Shorthand for \-gdb tcp::1234, i.e. open a gdbserver on \s-1TCP\s0 port 1234. +.IP "\fB\-d\fR" 4 +.IX Item "-d" +Output log in /tmp/qemu.log +.IP "\fB\-hdachs\fR \fIc\fR\fB,\fR\fIh\fR\fB,\fR\fIs\fR\fB,[,\fR\fIt\fR\fB]\fR" 4 +.IX Item "-hdachs c,h,s,[,t]" +Force hard disk 0 physical geometry (1 <= \fIc\fR <= 16383, 1 <= +\&\fIh\fR <= 16, 1 <= \fIs\fR <= 63) and optionally force the \s-1BIOS\s0 +translation mode (\fIt\fR=none, lba or auto). Usually \s-1QEMU\s0 can guess +all those parameters. This option is useful for old MS-DOS disk +images. +.IP "\fB\-L\fR \fIpath\fR" 4 +.IX Item "-L path" +Set the directory for the \s-1BIOS\s0, \s-1VGA\s0 \s-1BIOS\s0 and keymaps. +.IP "\fB\-bios\fR \fIfile\fR" 4 +.IX Item "-bios file" +Set the filename for the \s-1BIOS\s0. +.IP "\fB\-enable\-kvm\fR" 4 +.IX Item "-enable-kvm" +Enable \s-1KVM\s0 full virtualization support. This option is only available +if \s-1KVM\s0 support is enabled when compiling. +.IP "\fB\-xen\-domid\fR \fIid\fR" 4 +.IX Item "-xen-domid id" +Specify xen guest domain \fIid\fR (\s-1XEN\s0 only). +.IP "\fB\-xen\-create\fR" 4 +.IX Item "-xen-create" +Create domain using xen hypercalls, bypassing xend. +Warning: should not be used when xend is in use (\s-1XEN\s0 only). +.IP "\fB\-xen\-attach\fR" 4 +.IX Item "-xen-attach" +Attach to existing xen domain. +xend will use this when starting qemu (\s-1XEN\s0 only). +.IP "\fB\-no\-reboot\fR" 4 +.IX Item "-no-reboot" +Exit instead of rebooting. +.IP "\fB\-no\-shutdown\fR" 4 +.IX Item "-no-shutdown" +Don't exit \s-1QEMU\s0 on guest shutdown, but instead only stop the emulation. +This allows for instance switching to monitor to commit changes to the +disk image. +.IP "\fB\-loadvm\fR \fIfile\fR" 4 +.IX Item "-loadvm file" +Start right away with a saved state (\f(CW\*(C`loadvm\*(C'\fR in monitor) +.IP "\fB\-daemonize\fR" 4 +.IX Item "-daemonize" +Daemonize the \s-1QEMU\s0 process after initialization. \s-1QEMU\s0 will not detach from +standard \s-1IO\s0 until it is ready to receive connections on any of its devices. +This option is a useful way for external programs to launch \s-1QEMU\s0 without having +to cope with initialization race conditions. +.IP "\fB\-option\-rom\fR \fIfile\fR" 4 +.IX Item "-option-rom file" +Load the contents of \fIfile\fR as an option \s-1ROM\s0. +This option is useful to load things like EtherBoot. +.IP "\fB\-clock\fR \fImethod\fR" 4 +.IX Item "-clock method" +Force the use of the given methods for timer alarm. To see what timers +are available use \-clock ?. +.IP "\fB\-rtc [base=utc|localtime|\fR\fIdate\fR\fB][,clock=host|vm][,driftfix=none|slew]\fR" 4 +.IX Item "-rtc [base=utc|localtime|date][,clock=host|vm][,driftfix=none|slew]" +Specify \fBbase\fR as \f(CW\*(C`utc\*(C'\fR or \f(CW\*(C`localtime\*(C'\fR to let the \s-1RTC\s0 start at the current +\&\s-1UTC\s0 or local time, respectively. \f(CW\*(C`localtime\*(C'\fR is required for correct date in +MS-DOS or Windows. To start at a specific point in time, provide \fIdate\fR in the +format \f(CW\*(C`2006\-06\-17T16:01:21\*(C'\fR or \f(CW\*(C`2006\-06\-17\*(C'\fR. The default base is \s-1UTC\s0. +.Sp +By default the \s-1RTC\s0 is driven by the host system time. This allows to use the +\&\s-1RTC\s0 as accurate reference clock inside the guest, specifically if the host +time is smoothly following an accurate external reference clock, e.g. via \s-1NTP\s0. +If you want to isolate the guest time from the host, even prevent it from +progressing during suspension, you can set \fBclock\fR to \f(CW\*(C`vm\*(C'\fR instead. +.Sp +Enable \fBdriftfix\fR (i386 targets only) if you experience time drift problems, +specifically with Windows' \s-1ACPI\s0 \s-1HAL\s0. This option will try to figure out how +many timer interrupts were not processed by the Windows guest and will +re-inject them. +.IP "\fB\-icount [\fR\fIN\fR\fB|auto]\fR" 4 +.IX Item "-icount [N|auto]" +Enable virtual instruction counter. The virtual cpu will execute one +instruction every 2^\fIN\fR ns of virtual time. If \f(CW\*(C`auto\*(C'\fR is specified +then the virtual cpu speed will be automatically adjusted to keep virtual +time within a few seconds of real time. +.Sp +Note that while this option can give deterministic behavior, it does not +provide cycle accurate emulation. Modern CPUs contain superscalar out of +order cores with complex cache hierarchies. The number of instructions +executed often has little or no correlation with actual performance. +.IP "\fB\-watchdog\fR \fImodel\fR" 4 +.IX Item "-watchdog model" +Create a virtual hardware watchdog device. Once enabled (by a guest +action), the watchdog must be periodically polled by an agent inside +the guest or else the guest will be restarted. +.Sp +The \fImodel\fR is the model of hardware watchdog to emulate. Choices +for model are: \f(CW\*(C`ib700\*(C'\fR (iBASE 700) which is a very simple \s-1ISA\s0 +watchdog with a single timer, or \f(CW\*(C`i6300esb\*(C'\fR (Intel 6300ESB I/O +controller hub) which is a much more featureful PCI-based dual-timer +watchdog. Choose a model for which your guest has drivers. +.Sp +Use \f(CW\*(C`\-watchdog ?\*(C'\fR to list available hardware models. Only one +watchdog can be enabled for a guest. +.IP "\fB\-watchdog\-action\fR \fIaction\fR" 4 +.IX Item "-watchdog-action action" +The \fIaction\fR controls what \s-1QEMU\s0 will do when the watchdog timer +expires. +The default is +\&\f(CW\*(C`reset\*(C'\fR (forcefully reset the guest). +Other possible actions are: +\&\f(CW\*(C`shutdown\*(C'\fR (attempt to gracefully shutdown the guest), +\&\f(CW\*(C`poweroff\*(C'\fR (forcefully poweroff the guest), +\&\f(CW\*(C`pause\*(C'\fR (pause the guest), +\&\f(CW\*(C`debug\*(C'\fR (print a debug message and continue), or +\&\f(CW\*(C`none\*(C'\fR (do nothing). +.Sp +Note that the \f(CW\*(C`shutdown\*(C'\fR action requires that the guest responds +to \s-1ACPI\s0 signals, which it may not be able to do in the sort of +situations where the watchdog would have expired, and thus +\&\f(CW\*(C`\-watchdog\-action shutdown\*(C'\fR is not recommended for production use. +.Sp +Examples: +.RS 4 +.ie n .IP """\-watchdog i6300esb \-watchdog\-action pause""" 4 +.el .IP "\f(CW\-watchdog i6300esb \-watchdog\-action pause\fR" 4 +.IX Item "-watchdog i6300esb -watchdog-action pause" +.PD 0 +.ie n .IP """\-watchdog ib700""" 4 +.el .IP "\f(CW\-watchdog ib700\fR" 4 +.IX Item "-watchdog ib700" +.RE +.RS 4 +.RE +.IP "\fB\-echr\fR \fInumeric_ascii_value\fR" 4 +.IX Item "-echr numeric_ascii_value" +.PD +Change the escape character used for switching to the monitor when using +monitor and serial sharing. The default is \f(CW0x01\fR when using the +\&\f(CW\*(C`\-nographic\*(C'\fR option. \f(CW0x01\fR is equal to pressing +\&\f(CW\*(C`Control\-a\*(C'\fR. You can select a different character from the ascii +control keys where 1 through 26 map to Control-a through Control-z. For +instance you could use the either of the following to change the escape +character to Control-t. +.RS 4 +.ie n .IP """\-echr 0x14""" 4 +.el .IP "\f(CW\-echr 0x14\fR" 4 +.IX Item "-echr 0x14" +.PD 0 +.ie n .IP """\-echr 20""" 4 +.el .IP "\f(CW\-echr 20\fR" 4 +.IX Item "-echr 20" +.RE +.RS 4 +.RE +.IP "\fB\-virtioconsole\fR \fIc\fR" 4 +.IX Item "-virtioconsole c" +.PD +Set virtio console. +.Sp +This option is maintained for backward compatibility. +.Sp +Please use \f(CW\*(C`\-device virtconsole\*(C'\fR for the new way of invocation. +.IP "\fB\-show\-cursor\fR" 4 +.IX Item "-show-cursor" +Show cursor. +.IP "\fB\-tb\-size\fR \fIn\fR" 4 +.IX Item "-tb-size n" +Set \s-1TB\s0 size. +.IP "\fB\-incoming\fR \fIport\fR" 4 +.IX Item "-incoming port" +Prepare for incoming migration, listen on \fIport\fR. +.IP "\fB\-nodefaults\fR" 4 +.IX Item "-nodefaults" +Don't create default devices. +.IP "\fB\-chroot\fR \fIdir\fR" 4 +.IX Item "-chroot dir" +Immediately before starting guest execution, chroot to the specified +directory. Especially useful in combination with \-runas. +.IP "\fB\-runas\fR \fIuser\fR" 4 +.IX Item "-runas user" +Immediately before starting guest execution, drop root privileges, switching +to the specified user. +.IP "\fB\-prom\-env\fR \fIvariable\fR\fB=\fR\fIvalue\fR" 4 +.IX Item "-prom-env variable=value" +Set OpenBIOS nvram \fIvariable\fR to given \fIvalue\fR (\s-1PPC\s0, \s-1SPARC\s0 only). +.IP "\fB\-semihosting\fR" 4 +.IX Item "-semihosting" +Semihosting mode (\s-1ARM\s0, M68K only). +.IP "\fB\-old\-param\fR" 4 +.IX Item "-old-param" +Old param mode (\s-1ARM\s0 only). +.IP "\fB\-readconfig\fR \fIfile\fR" 4 +.IX Item "-readconfig file" +Read device configuration from \fIfile\fR. +.IP "\fB\-writeconfig\fR \fIfile\fR" 4 +.IX Item "-writeconfig file" +Write device configuration to \fIfile\fR. +.IP "\fB\-nodefconfig\fR" 4 +.IX Item "-nodefconfig" +Normally \s-1QEMU\s0 loads a configuration file from \fIsysconfdir\fR/qemu.conf and +\&\fIsysconfdir\fR/target\-\fI\s-1ARCH\s0\fR.conf on startup. The \f(CW\*(C`\-nodefconfig\*(C'\fR +option will prevent \s-1QEMU\s0 from loading these configuration files at startup. +.PP +During the graphical emulation, you can use the following keys: +.IP "\fBCtrl-Alt-f\fR" 4 +.IX Item "Ctrl-Alt-f" +Toggle full screen +.IP "\fBCtrl-Alt-u\fR" 4 +.IX Item "Ctrl-Alt-u" +Restore the screen's un-scaled dimensions +.IP "\fBCtrl-Alt-n\fR" 4 +.IX Item "Ctrl-Alt-n" +Switch to virtual console 'n'. Standard console mappings are: +.RS 4 +.IP "\fI1\fR" 4 +.IX Item "1" +Target system display +.IP "\fI2\fR" 4 +.IX Item "2" +Monitor +.IP "\fI3\fR" 4 +.IX Item "3" +Serial port +.RE +.RS 4 +.RE +.IP "\fBCtrl-Alt\fR" 4 +.IX Item "Ctrl-Alt" +Toggle mouse and keyboard grab. +.PP +In the virtual consoles, you can use \fBCtrl-Up\fR, \fBCtrl-Down\fR, +\&\fBCtrl-PageUp\fR and \fBCtrl-PageDown\fR to move in the back log. +.PP +During emulation, if you are using the \fB\-nographic\fR option, use +\&\fBCtrl-a h\fR to get terminal commands: +.IP "\fBCtrl-a h\fR" 4 +.IX Item "Ctrl-a h" +.PD 0 +.IP "\fBCtrl-a ?\fR" 4 +.IX Item "Ctrl-a ?" +.PD +Print this help +.IP "\fBCtrl-a x\fR" 4 +.IX Item "Ctrl-a x" +Exit emulator +.IP "\fBCtrl-a s\fR" 4 +.IX Item "Ctrl-a s" +Save disk data back to file (if \-snapshot) +.IP "\fBCtrl-a t\fR" 4 +.IX Item "Ctrl-a t" +Toggle console timestamps +.IP "\fBCtrl-a b\fR" 4 +.IX Item "Ctrl-a b" +Send break (magic sysrq in Linux) +.IP "\fBCtrl-a c\fR" 4 +.IX Item "Ctrl-a c" +Switch between console and monitor +.IP "\fBCtrl-a Ctrl-a\fR" 4 +.IX Item "Ctrl-a Ctrl-a" +Send Ctrl-a +.PP +The following options are specific to the PowerPC emulation: +.IP "\fB\-g\fR \fIW\fR\fBx\fR\fIH\fR\fB[x\fR\fI\s-1DEPTH\s0\fR\fB]\fR" 4 +.IX Item "-g WxH[xDEPTH]" +Set the initial \s-1VGA\s0 graphic mode. The default is 800x600x15. +.IP "\fB\-prom\-env\fR \fIstring\fR" 4 +.IX Item "-prom-env string" +Set OpenBIOS variables in \s-1NVRAM\s0, for example: +.Sp +.Vb 3 +\& qemu\-system\-ppc \-prom\-env \*(Aqauto\-boot?=false\*(Aq \e +\& \-prom\-env \*(Aqboot\-device=hd:2,\eyaboot\*(Aq \e +\& \-prom\-env \*(Aqboot\-args=conf=hd:2,\eyaboot.conf\*(Aq +.Ve +.Sp +These variables are not used by Open Hack'Ware. +.PP +The following options are specific to the Sparc32 emulation: +.IP "\fB\-g\fR \fIW\fR\fBx\fR\fIH\fR\fBx[x\fR\fI\s-1DEPTH\s0\fR\fB]\fR" 4 +.IX Item "-g WxHx[xDEPTH]" +Set the initial \s-1TCX\s0 graphic mode. The default is 1024x768x8, currently +the only other possible mode is 1024x768x24. +.IP "\fB\-prom\-env\fR \fIstring\fR" 4 +.IX Item "-prom-env string" +Set OpenBIOS variables in \s-1NVRAM\s0, for example: +.Sp +.Vb 2 +\& qemu\-system\-sparc \-prom\-env \*(Aqauto\-boot?=false\*(Aq \e +\& \-prom\-env \*(Aqboot\-device=sd(0,2,0):d\*(Aq \-prom\-env \*(Aqboot\-args=linux single\*(Aq +.Ve +.IP "\fB\-M [SS\-4|SS\-5|SS\-10|SS\-20|SS\-600MP|LX|Voyager|SPARCClassic] [|SPARCbook|SS\-2|SS\-1000|SS\-2000]\fR" 4 +.IX Item "-M [SS-4|SS-5|SS-10|SS-20|SS-600MP|LX|Voyager|SPARCClassic] [|SPARCbook|SS-2|SS-1000|SS-2000]" +Set the emulated machine type. Default is \s-1SS\-5\s0. +.PP +The following options are specific to the Sparc64 emulation: +.IP "\fB\-prom\-env\fR \fIstring\fR" 4 +.IX Item "-prom-env string" +Set OpenBIOS variables in \s-1NVRAM\s0, for example: +.Sp +.Vb 1 +\& qemu\-system\-sparc64 \-prom\-env \*(Aqauto\-boot?=false\*(Aq +.Ve +.IP "\fB\-M [sun4u|sun4v|Niagara]\fR" 4 +.IX Item "-M [sun4u|sun4v|Niagara]" +Set the emulated machine type. The default is sun4u. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +The \s-1HTML\s0 documentation of \s-1QEMU\s0 for more precise information and Linux +user mode emulator invocation. +.SH "AUTHOR" +.IX Header "AUTHOR" +Fabrice Bellard diff -Naur qemu-kvm-0.13.0/roms/seabios/config.mak qemu-0.13.0-patched/roms/seabios/config.mak --- qemu-kvm-0.13.0/roms/seabios/config.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/roms/seabios/config.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1,9 @@ +# Automatically generated by configure - do not modify +SRC_PATH=/usr/src/qemu-0.13.0/roms/seabios +CC=gcc +BCC=bcc +CPP=cpp +OBJCOPY=objcopy +IASL=iasl +HOST_CC=gcc +LD=ld diff -Naur qemu-kvm-0.13.0/roms/vgabios/config.mak qemu-0.13.0-patched/roms/vgabios/config.mak --- qemu-kvm-0.13.0/roms/vgabios/config.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/roms/vgabios/config.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1,9 @@ +# Automatically generated by configure - do not modify +SRC_PATH=/usr/src/qemu-0.13.0/roms/vgabios +CC=gcc +BCC=bcc +CPP=cpp +OBJCOPY=objcopy +IASL=iasl +HOST_CC=gcc +LD=ld diff -Naur qemu-kvm-0.13.0/x86_64-softmmu/config-devices.mak qemu-0.13.0-patched/x86_64-softmmu/config-devices.mak --- qemu-kvm-0.13.0/x86_64-softmmu/config-devices.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/x86_64-softmmu/config-devices.mak 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,25 @@ +# Default configuration for x86_64-softmmu + +CONFIG_USB_OHCI=y +CONFIG_VGA_PCI=y +CONFIG_VGA_ISA=y +CONFIG_VMWARE_VGA=y +CONFIG_SERIAL=y +CONFIG_PARALLEL=y +CONFIG_I8254=y +CONFIG_PCSPK=y +CONFIG_PCKBD=y +CONFIG_USB_UHCI=y +CONFIG_FDC=y +CONFIG_ACPI=y +CONFIG_APM=y +CONFIG_DMA=y +CONFIG_IDE_CORE=y +CONFIG_IDE_QDEV=y +CONFIG_IDE_PCI=y +CONFIG_IDE_ISA=y +CONFIG_IDE_PIIX=y +CONFIG_NE2000_ISA=y +CONFIG_PIIX_PCI=y +CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y diff -Naur qemu-kvm-0.13.0/x86_64-softmmu/config-devices.mak.old qemu-0.13.0-patched/x86_64-softmmu/config-devices.mak.old --- qemu-kvm-0.13.0/x86_64-softmmu/config-devices.mak.old 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/x86_64-softmmu/config-devices.mak.old 2011-06-19 16:52:32.000000000 -0400 @@ -0,0 +1,25 @@ +# Default configuration for x86_64-softmmu + +CONFIG_USB_OHCI=y +CONFIG_VGA_PCI=y +CONFIG_VGA_ISA=y +CONFIG_VMWARE_VGA=y +CONFIG_SERIAL=y +CONFIG_PARALLEL=y +CONFIG_I8254=y +CONFIG_PCSPK=y +CONFIG_PCKBD=y +CONFIG_USB_UHCI=y +CONFIG_FDC=y +CONFIG_ACPI=y +CONFIG_APM=y +CONFIG_DMA=y +CONFIG_IDE_CORE=y +CONFIG_IDE_QDEV=y +CONFIG_IDE_PCI=y +CONFIG_IDE_ISA=y +CONFIG_IDE_PIIX=y +CONFIG_NE2000_ISA=y +CONFIG_PIIX_PCI=y +CONFIG_SOUND=y +CONFIG_VIRTIO_PCI=y diff -Naur qemu-kvm-0.13.0/x86_64-softmmu/config-target.mak qemu-0.13.0-patched/x86_64-softmmu/config-target.mak --- qemu-kvm-0.13.0/x86_64-softmmu/config-target.mak 1969-12-31 19:00:00.000000000 -0500 +++ qemu-0.13.0-patched/x86_64-softmmu/config-target.mak 2011-06-19 16:52:15.000000000 -0400 @@ -0,0 +1,22 @@ +# Automatically generated by configure - do not modify +CONFIG_QEMU_INTERP_PREFIX="/usr/gnemul/qemu-x86_64" +TARGET_ARCH=x86_64 +TARGET_X86_64=y +TARGET_ARCH2=x86_64 +TARGET_BASE_ARCH=i386 +TARGET_ABI_DIR=x86_64 +CONFIG_KVM=y +KVM_CFLAGS=-I/usr/src/qemu-0.13.0/kvm/include -include /usr/src/qemu-0.13.0/kvm/include/linux/config.h -I/usr/src/qemu-0.13.0/kvm/include/x86 -idirafter /usr/src/qemu-0.13.0/compat +CONFIG_KVM_PARA=y +CONFIG_KVM_PIT=y +CONFIG_KVM_DEVICE_ASSIGNMENT=y +CONFIG_VHOST_NET=y +TARGET_PHYS_ADDR_BITS=64 +CONFIG_SOFTMMU=y +LIBS+=-lutil -lbluetooth -lcurl -lncurses -lvdeplug -luuid -lpng -ljpeg -lsasl2 -lgnutls -lSDL -lpthread -lX11 -laio +HWDIR=../libhw64 +CONFIG_NOSOFTFLOAT=y +CONFIG_I386_DIS=y +CONFIG_I386_DIS=y +LDFLAGS+= +QEMU_CFLAGS+=-DHAS_AUDIO -DHAS_AUDIO_CHOICE -I$(SRC_PATH)/fpu -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)