
1: \input texinfo @c -*- texinfo -*- 2: @c %**start of header 3: @setfilename qemu-doc.info 4: @settitle QEMU Emulator User Documentation 5: @exampleindent 0 6: @paragraphindent 0 7: @c %**end of header 8: 9: @iftex 10: @titlepage 11: @sp 7 12: @center @titlefont{QEMU Emulator} 13: @sp 1 14: @center @titlefont{User Documentation} 15: @sp 3 16: @end titlepage 17: @end iftex 18: 19: @ifnottex 20: @node Top 21: @top 22: 23: @menu 24: * Introduction:: 25: * Installation:: 26: * QEMU PC System emulator:: 27: * QEMU System emulator for non PC targets:: 28: * QEMU User space emulator:: 29: * compilation:: Compilation from the sources 30: * Index:: 31: @end menu 32: @end ifnottex 33: 34: @contents 35: 36: @node Introduction 37: @chapter Introduction 38: 39: @menu 40: * intro_features:: Features 41: @end menu 42: 43: @node intro_features 44: @section Features 45: 46: QEMU is a FAST! processor emulator using dynamic translation to 47: achieve good emulation speed. 48: 49: QEMU has two operating modes: 50: 51: @itemize @minus 52: 53: @item 54: Full system emulation. In this mode, QEMU emulates a full system (for 55: example a PC), including one or several processors and various 56: peripherals. It can be used to launch different Operating Systems 57: without rebooting the PC or to debug system code. 58: 59: @item 60: User mode emulation. In this mode, QEMU can launch 61: processes compiled for one CPU on another CPU. It can be used to 62: launch the Wine Windows API emulator (@url{http://www.winehq.org}) or 63: to ease cross-compilation and cross-debugging. 64: 65: @end itemize 66: 67: QEMU can run without an host kernel driver and yet gives acceptable 68: performance. 69: 70: For system emulation, the following hardware targets are supported: 71: @itemize 72: @item PC (x86 or x86_64 processor) 73: @item ISA PC (old style PC without PCI bus) 74: @item PREP (PowerPC processor) 75: @item G3 BW PowerMac (PowerPC processor) 76: @item Mac99 PowerMac (PowerPC processor, in progress) 77: @item Sun4m/Sun4c/Sun4d (32-bit Sparc processor) 78: @item Sun4u (64-bit Sparc processor, in progress) 79: @item Malta board (32-bit and 64-bit MIPS processors) 80: @item ARM Integrator/CP (ARM) 81: @item ARM Versatile baseboard (ARM) 82: @item ARM RealView Emulation baseboard (ARM) 83: @item Spitz, Akita, Borzoi and Terrier PDAs (PXA270 processor) 84: @item Luminary Micro LM3S811EVB (ARM Cortex-M3) 85: @item Luminary Micro LM3S6965EVB (ARM Cortex-M3) 86: @item Freescale MCF5208EVB (ColdFire V2). 87: @item Arnewsh MCF5206 evaluation board (ColdFire V2). 88: @item Palm Tungsten|E PDA (OMAP310 processor) 89: @end itemize 90: 91: For user emulation, x86, PowerPC, ARM, 32-bit MIPS, Sparc32/64 and ColdFire(m68k) CPUs are supported. 92: 93: @node Installation 94: @chapter Installation 95: 96: If you want to compile QEMU yourself, see @ref{compilation}. 97: 98: @menu 99: * install_linux:: Linux 100: * install_windows:: Windows 101: * install_mac:: Macintosh 102: @end menu 103: 104: @node install_linux 105: @section Linux 106: 107: If a precompiled package is available for your distribution - you just 108: have to install it. Otherwise, see @ref{compilation}. 109: 110: @node install_windows 111: @section Windows 112: 113: Download the experimental binary installer at 114: @url{http://www.free.oszoo.org/@/download.html}. 115: 116: @node install_mac 117: @section Mac OS X 118: 119: Download the experimental binary installer at 120: @url{http://www.free.oszoo.org/@/download.html}. 121: 122: @node QEMU PC System emulator 123: @chapter QEMU PC System emulator 124: 125: @menu 126: * pcsys_introduction:: Introduction 127: * pcsys_quickstart:: Quick Start 128: * sec_invocation:: Invocation 129: * pcsys_keys:: Keys 130: * pcsys_monitor:: QEMU Monitor 131: * disk_images:: Disk Images 132: * pcsys_network:: Network emulation 133: * direct_linux_boot:: Direct Linux Boot 134: * pcsys_usb:: USB emulation 135: * vnc_security:: VNC security 136: * gdb_usage:: GDB usage 137: * pcsys_os_specific:: Target OS specific information 138: @end menu 139: 140: @node pcsys_introduction 141: @section Introduction 142: 143: @c man begin DESCRIPTION 144: 145: The QEMU PC System emulator simulates the 146: following peripherals: 147: 148: @itemize @minus 149: @item 150: i440FX host PCI bridge and PIIX3 PCI to ISA bridge 151: @item 152: Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA 153: extensions (hardware level, including all non standard modes). 154: @item 155: PS/2 mouse and keyboard 156: @item 157: 2 PCI IDE interfaces with hard disk and CD-ROM support 158: @item 159: Floppy disk 160: @item 161: PCI/ISA PCI network adapters 162: @item 163: Serial ports 164: @item 165: Creative SoundBlaster 16 sound card 166: @item 167: ENSONIQ AudioPCI ES1370 sound card 168: @item 169: Adlib(OPL2) - Yamaha YM3812 compatible chip 170: @item 171: PCI UHCI USB controller and a virtual USB hub. 172: @end itemize 173: 174: SMP is supported with up to 255 CPUs. 175: 176: Note that adlib is only available when QEMU was configured with 177: -enable-adlib 178: 179: QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL 180: VGA BIOS. 181: 182: QEMU uses YM3812 emulation by Tatsuyuki Satoh. 183: 184: @c man end 185: 186: @node pcsys_quickstart 187: @section Quick Start 188: 189: Download and uncompress the linux image (@file{linux.img}) and type: 190: 191: @example 192: qemu linux.img 193: @end example 194: 195: Linux should boot and give you a prompt. 196: 197: @node sec_invocation 198: @section Invocation 199: 200: @example 201: @c man begin SYNOPSIS 202: usage: qemu [options] [@var{disk_image}] 203: @c man end 204: @end example 205: 206: @c man begin OPTIONS 207: @var{disk_image} is a raw hard disk image for IDE hard disk 0. 208: 209: General options: 210: @table @option 211: @item -M @var{machine} 212: Select the emulated @var{machine} (@code{-M ?} for list) 213: 214: @item -fda @var{file} 215: @item -fdb @var{file} 216: Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can 217: use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}). 218: 219: @item -hda @var{file} 220: @item -hdb @var{file} 221: @item -hdc @var{file} 222: @item -hdd @var{file} 223: Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}). 224: 225: @item -cdrom @var{file} 226: Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and 227: @option{-cdrom} at the same time). You can use the host CD-ROM by 228: using @file{/dev/cdrom} as filename (@pxref{host_drives}). 229: 230: @item -drive @var{option}[,@var{option}[,@var{option}[,...]]] 231: 232: Define a new drive. Valid options are: 233: 234: @table @code 235: @item file=@var{file} 236: This option defines which disk image (@pxref{disk_images}) to use with 237: this drive. 238: @item if=@var{interface} 239: This option defines on which type on interface the drive is connected. 240: Available types are: ide, scsi, sd, mtd, floppy, pflash. 241: @item bus=@var{bus},unit=@var{unit} 242: These options define where is connected the drive by defining the bus number and 243: the unit id. 244: @item index=@var{index} 245: This option defines where is connected the drive by using an index in the list 246: of available connectors of a given interface type. 247: @item media=@var{media} 248: This option defines the type of the media: disk or cdrom. 249: @item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}] 250: These options have the same definition as they have in @option{-hdachs}. 251: @item snapshot=@var{snapshot} 252: @var{snapshot} is "on" or "off" and allows to enable snapshot for given drive (see @option{-snapshot}). 253: @item cache=@var{cache} 254: @var{cache} is "on" or "off" and allows to disable host cache to access data. 255: @end table 256: 257: Instead of @option{-cdrom} you can use: 258: @example 259: qemu -drive file=file,index=2,media=cdrom 260: @end example 261: 262: Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can 263: use: 264: @example 265: qemu -drive file=file,index=0,media=disk 266: qemu -drive file=file,index=1,media=disk 267: qemu -drive file=file,index=2,media=disk 268: qemu -drive file=file,index=3,media=disk 269: @end example 270: 271: You can connect a CDROM to the slave of ide0: 272: @example 273: qemu -drive file=file,if=ide,index=1,media=cdrom 274: @end example 275: 276: If you don't specify the "file=" argument, you define an empty drive: 277: @example 278: qemu -drive if=ide,index=1,media=cdrom 279: @end example 280: 281: You can connect a SCSI disk with unit ID 6 on the bus #0: 282: @example 283: qemu -drive file=file,if=scsi,bus=0,unit=6 284: @end example 285: 286: Instead of @option{-fda}, @option{-fdb}, you can use: 287: @example 288: qemu -drive file=file,index=0,if=floppy 289: qemu -drive file=file,index=1,if=floppy 290: @end example 291: 292: By default, @var{interface} is "ide" and @var{index} is automatically 293: incremented: 294: @example 295: qemu -drive file=a -drive file=b" 296: @end example 297: is interpreted like: 298: @example 299: qemu -hda a -hdb b 300: @end example 301: 302: @item -boot [a|c|d|n] 303: Boot on floppy (a), hard disk (c), CD-ROM (d), or Etherboot (n). Hard disk boot 304: is the default. 305: 306: @item -snapshot 307: Write to temporary files instead of disk image files. In this case, 308: the raw disk image you use is not written back. You can however force 309: the write back by pressing @key{C-a s} (@pxref{disk_images}). 310: 311: @item -no-fd-bootchk 312: Disable boot signature checking for floppy disks in Bochs BIOS. It may 313: be needed to boot from old floppy disks. 314: 315: @item -m @var{megs} 316: Set virtual RAM size to @var{megs} megabytes. Default is 128 MiB. 317: 318: @item -smp @var{n} 319: Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255 320: CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs 321: to 4. 322: 323: @item -audio-help 324: 325: Will show the audio subsystem help: list of drivers, tunable 326: parameters. 327: 328: @item -soundhw @var{card1}[,@var{card2},...] or -soundhw all 329: 330: Enable audio and selected sound hardware. Use ? to print all 331: available sound hardware. 332: 333: @example 334: qemu -soundhw sb16,adlib hda 335: qemu -soundhw es1370 hda 336: qemu -soundhw all hda 337: qemu -soundhw ? 338: @end example 339: 340: @item -localtime 341: Set the real time clock to local time (the default is to UTC 342: time). This option is needed to have correct date in MS-DOS or 343: Windows. 344: 345: @item -startdate @var{date} 346: Set the initial date of the real time clock. Valid format for 347: @var{date} are: @code{now} or @code{2006-06-17T16:01:21} or 348: @code{2006-06-17}. The default value is @code{now}. 349: 350: @item -pidfile @var{file} 351: Store the QEMU process PID in @var{file}. It is useful if you launch QEMU 352: from a script. 353: 354: @item -daemonize 355: Daemonize the QEMU process after initialization. QEMU will not detach from 356: standard IO until it is ready to receive connections on any of its devices. 357: This option is a useful way for external programs to launch QEMU without having 358: to cope with initialization race conditions. 359: 360: @item -win2k-hack 361: Use it when installing Windows 2000 to avoid a disk full bug. After 362: Windows 2000 is installed, you no longer need this option (this option 363: slows down the IDE transfers). 364: 365: @item -option-rom @var{file} 366: Load the contents of @var{file} as an option ROM. 367: This option is useful to load things like EtherBoot. 368: 369: @item -name @var{name} 370: Sets the @var{name} of the guest. 371: This name will be display in the SDL window caption. 372: The @var{name} will also be used for the VNC server. 373: 374: @end table 375: 376: Display options: 377: @table @option 378: 379: @item -nographic 380: 381: Normally, QEMU uses SDL to display the VGA output. With this option, 382: you can totally disable graphical output so that QEMU is a simple 383: command line application. The emulated serial port is redirected on 384: the console. Therefore, you can still use QEMU to debug a Linux kernel 385: with a serial console. 386: 387: @item -no-frame 388: 389: Do not use decorations for SDL windows and start them using the whole 390: available screen space. This makes the using QEMU in a dedicated desktop 391: workspace more convenient. 392: 393: @item -full-screen 394: Start in full screen. 395: 396: @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]] 397: 398: Normally, QEMU uses SDL to display the VGA output. With this option, 399: you can have QEMU listen on VNC display @var{display} and redirect the VGA 400: display over the VNC session. It is very useful to enable the usb 401: tablet device when using this option (option @option{-usbdevice 402: tablet}). When using the VNC display, you must use the @option{-k} 403: parameter to set the keyboard layout if you are not using en-us. Valid 404: syntax for the @var{display} is 405: 406: @table @code 407: 408: @item @var{interface}:@var{d} 409: 410: TCP connections will only be allowed from @var{interface} on display @var{d}. 411: By convention the TCP port is 5900+@var{d}. Optionally, @var{interface} can 412: be omitted in which case the server will bind to all interfaces. 413: 414: @item @var{unix}:@var{path} 415: 416: Connections will be allowed over UNIX domain sockets where @var{path} is the 417: location of a unix socket to listen for connections on. 418: 419: @item none 420: 421: VNC is initialized by not started. The monitor @code{change} command can be used 422: to later start the VNC server. 423: 424: @end table 425: 426: Following the @var{display} value there may be one or more @var{option} flags 427: separated by commas. Valid options are 428: 429: @table @code 430: 431: @item password 432: 433: Require that password based authentication is used for client connections. 434: The password must be set separately using the @code{change} command in the 435: @ref{pcsys_monitor} 436: 437: @item tls 438: 439: Require that client use TLS when communicating with the VNC server. This 440: uses anonymous TLS credentials so is susceptible to a man-in-the-middle 441: attack. It is recommended that this option be combined with either the 442: @var{x509} or @var{x509verify} options. 443: 444: @item x509=@var{/path/to/certificate/dir} 445: 446: Valid if @option{tls} is specified. Require that x509 credentials are used 447: for negotiating the TLS session. The server will send its x509 certificate 448: to the client. It is recommended that a password be set on the VNC server 449: to provide authentication of the client when this is used. The path following 450: this option specifies where the x509 certificates are to be loaded from. 451: See the @ref{vnc_security} section for details on generating certificates. 452: 453: @item x509verify=@var{/path/to/certificate/dir} 454: 455: Valid if @option{tls} is specified. Require that x509 credentials are used 456: for negotiating the TLS session. The server will send its x509 certificate 457: to the client, and request that the client send its own x509 certificate. 458: The server will validate the client's certificate against the CA certificate, 459: and reject clients when validation fails. If the certificate authority is 460: trusted, this is a sufficient authentication mechanism. You may still wish 461: to set a password on the VNC server as a second authentication layer. The 462: path following this option specifies where the x509 certificates are to 463: be loaded from. See the @ref{vnc_security} section for details on generating 464: certificates. 465: 466: @end table 467: 468: @item -k @var{language} 469: 470: Use keyboard layout @var{language} (for example @code{fr} for 471: French). This option is only needed where it is not easy to get raw PC 472: keycodes (e.g. on Macs, with some X11 servers or with a VNC 473: display). You don't normally need to use it on PC/Linux or PC/Windows 474: hosts. 475: 476: The available layouts are: 477: @example 478: ar de-ch es fo fr-ca hu ja mk no pt-br sv 479: da en-gb et fr fr-ch is lt nl pl ru th 480: de en-us fi fr-be hr it lv nl-be pt sl tr 481: @end example 482: 483: The default is @code{en-us}. 484: 485: @end table 486: 487: USB options: 488: @table @option 489: 490: @item -usb 491: Enable the USB driver (will be the default soon) 492: 493: @item -usbdevice @var{devname} 494: Add the USB device @var{devname}. @xref{usb_devices}. 495: @end table 496: 497: Network options: 498: 499: @table @option 500: 501: @item -net nic[,vlan=@var{n}][,macaddr=@var{addr}][,model=@var{type}] 502: Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n} 503: = 0 is the default). The NIC is an ne2k_pci by default on the PC 504: target. Optionally, the MAC address can be changed. If no 505: @option{-net} option is specified, a single NIC is created. 506: Qemu can emulate several different models of network card. 507: Valid values for @var{type} are 508: @code{i82551}, @code{i82557b}, @code{i82559er}, 509: @code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139}, 510: @code{smc91c111}, @code{lance} and @code{mcf_fec}. 511: Not all devices are supported on all targets. Use -net nic,model=? 512: for a list of available devices for your target. 513: 514: @item -net user[,vlan=@var{n}][,hostname=@var{name}] 515: Use the user mode network stack which requires no administrator 516: privilege to run. @option{hostname=name} can be used to specify the client 517: hostname reported by the builtin DHCP server. 518: 519: @item -net tap[,vlan=@var{n}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}] 520: Connect the host TAP network interface @var{name} to VLAN @var{n} and 521: use the network script @var{file} to configure it. The default 522: network script is @file{/etc/qemu-ifup}. Use @option{script=no} to 523: disable script execution. If @var{name} is not 524: provided, the OS automatically provides one. @option{fd}=@var{h} can be 525: used to specify the handle of an already opened host TAP interface. Example: 526: 527: @example 528: qemu linux.img -net nic -net tap 529: @end example 530: 531: More complicated example (two NICs, each one connected to a TAP device) 532: @example 533: qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ 534: -net nic,vlan=1 -net tap,vlan=1,ifname=tap1 535: @end example 536: 537: 538: @item -net socket[,vlan=@var{n}][,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] 539: 540: Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual 541: machine using a TCP socket connection. If @option{listen} is 542: specified, QEMU waits for incoming connections on @var{port} 543: (@var{host} is optional). @option{connect} is used to connect to 544: another QEMU instance using the @option{listen} option. @option{fd}=@var{h} 545: specifies an already opened TCP socket. 546: 547: Example: 548: @example 549: # launch a first QEMU instance 550: qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ 551: -net socket,listen=:1234 552: # connect the VLAN 0 of this instance to the VLAN 0 553: # of the first instance 554: qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ 555: -net socket,connect=127.0.0.1:1234 556: @end example 557: 558: @item -net socket[,vlan=@var{n}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}] 559: 560: Create a VLAN @var{n} shared with another QEMU virtual 561: machines using a UDP multicast socket, effectively making a bus for 562: every QEMU with same multicast address @var{maddr} and @var{port}. 563: NOTES: 564: @enumerate 565: @item 566: Several QEMU can be running on different hosts and share same bus (assuming 567: correct multicast setup for these hosts). 568: @item 569: mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see 570: @url{http://user-mode-linux.sf.net}. 571: @item 572: Use @option{fd=h} to specify an already opened UDP multicast socket. 573: @end enumerate 574: 575: Example: 576: @example 577: # launch one QEMU instance 578: qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ 579: -net socket,mcast=230.0.0.1:1234 580: # launch another QEMU instance on same "bus" 581: qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ 582: -net socket,mcast=230.0.0.1:1234 583: # launch yet another QEMU instance on same "bus" 584: qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \ 585: -net socket,mcast=230.0.0.1:1234 586: @end example 587: 588: Example (User Mode Linux compat.): 589: @example 590: # launch QEMU instance (note mcast address selected 591: # is UML's default) 592: qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ 593: -net socket,mcast=239.192.168.1:1102 594: # launch UML 595: /path/to/linux ubd0=/path/to/root_fs eth0=mcast 596: @end example 597: 598: @item -net none 599: Indicate that no network devices should be configured. It is used to 600: override the default configuration (@option{-net nic -net user}) which 601: is activated if no @option{-net} options are provided. 602: 603: @item -tftp @var{dir} 604: When using the user mode network stack, activate a built-in TFTP 605: server. The files in @var{dir} will be exposed as the root of a TFTP server. 606: The TFTP client on the guest must be configured in binary mode (use the command 607: @code{bin} of the Unix TFTP client). The host IP address on the guest is as 608: usual 10.0.2.2. 609: 610: @item -bootp @var{file} 611: When using the user mode network stack, broadcast @var{file} as the BOOTP 612: filename. In conjunction with @option{-tftp}, this can be used to network boot 613: a guest from a local directory. 614: 615: Example (using pxelinux): 616: @example 617: qemu -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0 618: @end example 619: 620: @item -smb @var{dir} 621: When using the user mode network stack, activate a built-in SMB 622: server so that Windows OSes can access to the host files in @file{@var{dir}} 623: transparently. 624: 625: In the guest Windows OS, the line: 626: @example 627: 10.0.2.4 smbserver 628: @end example 629: must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me) 630: or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000). 631: 632: Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}. 633: 634: Note that a SAMBA server must be installed on the host OS in 635: @file{/usr/sbin/smbd}. QEMU was tested successfully with smbd version 636: 2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3. 637: 638: @item -redir [tcp|udp]:@var{host-port}:[@var{guest-host}]:@var{guest-port} 639: 640: When using the user mode network stack, redirect incoming TCP or UDP 641: connections to the host port @var{host-port} to the guest 642: @var{guest-host} on guest port @var{guest-port}. If @var{guest-host} 643: is not specified, its value is 10.0.2.15 (default address given by the 644: built-in DHCP server). 645: 646: For example, to redirect host X11 connection from screen 1 to guest 647: screen 0, use the following: 648: 649: @example 650: # on the host 651: qemu -redir tcp:6001::6000 [...] 652: # this host xterm should open in the guest X11 server 653: xterm -display :1 654: @end example 655: 656: To redirect telnet connections from host port 5555 to telnet port on 657: the guest, use the following: 658: 659: @example 660: # on the host 661: qemu -redir tcp:5555::23 [...] 662: telnet localhost 5555 663: @end example 664: 665: Then when you use on the host @code{telnet localhost 5555}, you 666: connect to the guest telnet server. 667: 668: @end table 669: 670: Linux boot specific: When using these options, you can use a given 671: Linux kernel without installing it in the disk image. It can be useful 672: for easier testing of various kernels. 673: 674: @table @option 675: 676: @item -kernel @var{bzImage} 677: Use @var{bzImage} as kernel image. 678: 679: @item -append @var{cmdline} 680: Use @var{cmdline} as kernel command line 681: 682: @item -initrd @var{file} 683: Use @var{file} as initial ram disk. 684: 685: @end table 686: 687: Debug/Expert options: 688: @table @option 689: 690: @item -serial @var{dev} 691: Redirect the virtual serial port to host character device 692: @var{dev}. The default device is @code{vc} in graphical mode and 693: @code{stdio} in non graphical mode. 694: 695: This option can be used several times to simulate up to 4 serials 696: ports. 697: 698: Use @code{-serial none} to disable all serial ports. 699: 700: Available character devices are: 701: @table @code 702: @item vc[:WxH] 703: Virtual console. Optionally, a width and height can be given in pixel with 704: @example 705: vc:800x600 706: @end example 707: It is also possible to specify width or height in characters: 708: @example 709: vc:80Cx24C 710: @end example 711: @item pty 712: [Linux only] Pseudo TTY (a new PTY is automatically allocated) 713: @item none 714: No device is allocated. 715: @item null 716: void device 717: @item /dev/XXX 718: [Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port 719: parameters are set according to the emulated ones. 720: @item /dev/parport@var{N} 721: [Linux only, parallel port only] Use host parallel port 722: @var{N}. Currently SPP and EPP parallel port features can be used. 723: @item file:@var{filename} 724: Write output to @var{filename}. No character can be read. 725: @item stdio 726: [Unix only] standard input/output 727: @item pipe:@var{filename} 728: name pipe @var{filename} 729: @item COM@var{n} 730: [Windows only] Use host serial port @var{n} 731: @item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}] 732: This implements UDP Net Console. 733: When @var{remote_host} or @var{src_ip} are not specified 734: they default to @code{0.0.0.0}. 735: When not using a specified @var{src_port} a random port is automatically chosen. 736: 737: If you just want a simple readonly console you can use @code{netcat} or 738: @code{nc}, by starting qemu with: @code{-serial udp::4555} and nc as: 739: @code{nc -u -l -p 4555}. Any time qemu writes something to that port it 740: will appear in the netconsole session. 741: 742: If you plan to send characters back via netconsole or you want to stop 743: and start qemu a lot of times, you should have qemu use the same 744: source port each time by using something like @code{-serial 745: udp::4555@@:4556} to qemu. Another approach is to use a patched 746: version of netcat which can listen to a TCP port and send and receive 747: characters via udp. If you have a patched version of netcat which 748: activates telnet remote echo and single char transfer, then you can 749: use the following options to step up a netcat redirector to allow 750: telnet on port 5555 to access the qemu port. 751: @table @code 752: @item Qemu Options: 753: -serial udp::4555@@:4556 754: @item netcat options: 755: -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T 756: @item telnet options: 757: localhost 5555 758: @end table 759: 760: 761: @item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay] 762: The TCP Net Console has two modes of operation. It can send the serial 763: I/O to a location or wait for a connection from a location. By default 764: the TCP Net Console is sent to @var{host} at the @var{port}. If you use 765: the @var{server} option QEMU will wait for a client socket application 766: to connect to the port before continuing, unless the @code{nowait} 767: option was specified. The @code{nodelay} option disables the Nagle buffering 768: algorithm. If @var{host} is omitted, 0.0.0.0 is assumed. Only 769: one TCP connection at a time is accepted. You can use @code{telnet} to 770: connect to the corresponding character device. 771: @table @code 772: @item Example to send tcp console to 192.168.0.2 port 4444 773: -serial tcp:192.168.0.2:4444 774: @item Example to listen and wait on port 4444 for connection 775: -serial tcp::4444,server 776: @item Example to not wait and listen on ip 192.168.0.100 port 4444 777: -serial tcp:192.168.0.100:4444,server,nowait 778: @end table 779: 780: @item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay] 781: The telnet protocol is used instead of raw tcp sockets. The options 782: work the same as if you had specified @code{-serial tcp}. The 783: difference is that the port acts like a telnet server or client using 784: telnet option negotiation. This will also allow you to send the 785: MAGIC_SYSRQ sequence if you use a telnet that supports sending the break 786: sequence. Typically in unix telnet you do it with Control-] and then 787: type "send break" followed by pressing the enter key. 788: 789: @item unix:@var{path}[,server][,nowait] 790: A unix domain socket is used instead of a tcp socket. The option works the 791: same as if you had specified @code{-serial tcp} except the unix domain socket 792: @var{path} is used for connections. 793: 794: @item mon:@var{dev_string} 795: This is a special option to allow the monitor to be multiplexed onto 796: another serial port. The monitor is accessed with key sequence of 797: @key{Control-a} and then pressing @key{c}. See monitor access 798: @ref{pcsys_keys} in the -nographic section for more keys. 799: @var{dev_string} should be any one of the serial devices specified 800: above. An example to multiplex the monitor onto a telnet server 801: listening on port 4444 would be: 802: @table @code 803: @item -serial mon:telnet::4444,server,nowait 804: @end table 805: 806: @end table