📄 qemu-doc.texi
字号:
@file{/usr/sbin/smbd}. QEMU was tested succesfully with smbd version2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3.@item -redir [tcp|udp]:host-port:[guest-host]:guest-portWhen using the user mode network stack, redirect incoming TCP or UDPconnections to the host port @var{host-port} to the guest@var{guest-host} on guest port @var{guest-port}. If @var{guest-host}is not specified, its value is 10.0.2.15 (default address given by thebuilt-in DHCP server).For example, to redirect host X11 connection from screen 1 to guestscreen 0, use the following:@example# on the hostqemu -redir tcp:6001::6000 [...]# this host xterm should open in the guest X11 serverxterm -display :1@end exampleTo redirect telnet connections from host port 5555 to telnet port onthe guest, use the following:@example# on the hostqemu -redir tcp:5555::23 [...]telnet localhost 5555@end exampleThen when you use on the host @code{telnet localhost 5555}, youconnect to the guest telnet server.@end tableLinux boot specific: When using these options, you can use a givenLinux kernel without installing it in the disk image. It can be usefulfor easier testing of various kernels.@table @option@item -kernel bzImage Use @var{bzImage} as kernel image.@item -append cmdline Use @var{cmdline} as kernel command line@item -initrd fileUse @var{file} as initial ram disk.@end tableDebug/Expert options:@table @option@item -serial devRedirect the virtual serial port to host device @var{dev}. Availabledevices are:@table @code@item vcVirtual console@item pty[Linux only] Pseudo TTY (a new PTY is automatically allocated)@item nullvoid device@item /dev/XXX[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial portparameters are set according to the emulated ones.@item /dev/parportN[Linux only, parallel port only] Use host parallel port@var{N}. Currently only SPP parallel port features can be used.@item file:filenameWrite output to filename. No character can be read.@item stdio[Unix only] standard input/output@item pipe:filename[Unix only] name pipe @var{filename}@end tableThe default device is @code{vc} in graphical mode and @code{stdio} innon graphical mode.This option can be used several times to simulate up to 4 serialsports.@item -parallel devRedirect the virtual parallel port to host device @var{dev} (samedevices as the serial port). On Linux hosts, @file{/dev/parportN} canbe used to use hardware devices connected on the corresponding hostparallel port.This option can be used several times to simulate up to 3 parallelports.@item -monitor devRedirect the monitor to host device @var{dev} (same devices as theserial port).The default device is @code{vc} in graphical mode and @code{stdio} innon graphical mode.@item -sWait gdb connection to port 1234 (@pxref{gdb_usage}). @item -p portChange gdb connection port.@item -SDo not start CPU at startup (you must type 'c' in the monitor).@item -d Output log in /tmp/qemu.log@item -hdachs c,h,s,[,t]Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <=@var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOStranslation mode (@var{t}=none, lba or auto). Usually QEMU can guessall thoses parameters. This option is useful for old MS-DOS diskimages.@item -std-vgaSimulate a standard VGA card with Bochs VBE extensions (default isCirrus Logic GD5446 PCI VGA)@item -loadvm fileStart right away with a saved state (@code{loadvm} in monitor)@end table@c man end@node pcsys_keys@section Keys@c man begin OPTIONSDuring the graphical emulation, you can use the following keys:@table @key@item Ctrl-Alt-fToggle full screen@item Ctrl-Alt-nSwitch to virtual console 'n'. Standard console mappings are:@table @emph@item 1Target system display@item 2Monitor@item 3Serial port@end table@item Ctrl-AltToggle mouse and keyboard grab.@end tableIn the virtual consoles, you can use @key{Ctrl-Up}, @key{Ctrl-Down},@key{Ctrl-PageUp} and @key{Ctrl-PageDown} to move in the back log.During emulation, if you are using the @option{-nographic} option, use@key{Ctrl-a h} to get terminal commands:@table @key@item Ctrl-a hPrint this help@item Ctrl-a x Exit emulatior@item Ctrl-a s Save disk data back to file (if -snapshot)@item Ctrl-a bSend break (magic sysrq in Linux)@item Ctrl-a cSwitch between console and monitor@item Ctrl-a Ctrl-aSend Ctrl-a@end table@c man end@ignore@c man begin SEEALSOThe HTML documentation of QEMU for more precise information and Linuxuser mode emulator invocation.@c man end@c man begin AUTHORFabrice Bellard@c man end@end ignore@node pcsys_monitor@section QEMU MonitorThe QEMU monitor is used to give complex commands to the QEMUemulator. You can use it to:@itemize @minus@itemRemove or insert removable medias images(such as CD-ROM or floppies)@item Freeze/unfreeze the Virtual Machine (VM) and save or restore its statefrom a disk file.@item Inspect the VM state without an external debugger.@end itemize@subsection CommandsThe following commands are available:@table @option@item help or ? [cmd]Show the help for all commands or just for command @var{cmd}.@item commit Commit changes to the disk images (if -snapshot is used)@item info subcommand show various information about the system state@table @option@item info networkshow the various VLANs and the associated devices@item info blockshow the block devices@item info registersshow the cpu registers@item info historyshow the command line history@item info pcishow emulated PCI device@item info usbshow USB devices plugged on the virtual USB hub@item info usbhostshow all USB host devices@end table@item q or quitQuit the emulator.@item eject [-f] deviceEject a removable media (use -f to force it).@item change device filenameChange a removable media.@item screendump filenameSave screen into PPM image @var{filename}.@item log item1[,...]Activate logging of the specified items to @file{/tmp/qemu.log}.@item savevm filenameSave the whole virtual machine state to @var{filename}.@item loadvm filenameRestore the whole virtual machine state from @var{filename}.@item stopStop emulation.@item c or contResume emulation.@item gdbserver [port]Start gdbserver session (default port=1234)@item x/fmt addrVirtual memory dump starting at @var{addr}.@item xp /fmt addrPhysical memory dump starting at @var{addr}.@var{fmt} is a format which tells the command how to format thedata. Its syntax is: @option{/@{count@}@{format@}@{size@}}@table @var@item count is the number of items to be dumped.@item formatcan be x (hexa), d (signed decimal), u (unsigned decimal), o (octal),c (char) or i (asm instruction).@item sizecan 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 torespectively select 16 or 32 bit code instruction size.@end tableExamples: @itemize@itemDump 10 instructions at the current instruction pointer:@example (qemu) x/10i $eip0x90107063: ret0x90107064: sti0x90107065: lea 0x0(%esi,1),%esi0x90107069: lea 0x0(%edi,1),%edi0x90107070: ret0x90107071: jmp 0x901070800x90107073: nop0x90107074: nop0x90107075: nop0x90107076: nop@end example@itemDump 80 16 bit values at the start of the video memory.@smallexample (qemu) xp/80hx 0xb80000x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b420x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b410x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b720x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b730x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b200x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x07200x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x07200x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x07200x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x07200x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720@end smallexample@end itemize@item p or print/fmt exprPrint expression value. Only the @var{format} part of @var{fmt} isused.@item sendkey keysSend @var{keys} to the emulator. Use @code{-} to press several keyssimultaneously. Example:@examplesendkey ctrl-alt-f1@end exampleThis command is useful to send keys that your graphical user interfaceintercepts at low level, such as @code{ctrl-alt-f1} in X Window.@item system_resetReset the system.@item usb_add devnamePlug the USB device devname to the QEMU virtual USB hub. @var{devname}is either a virtual device name (for example @code{mouse}) or a hostUSB device identifier. Host USB device identifiers have the followingsyntax: @code{host:bus.addr} or @code{host:vendor_id:product_id}.@item usb_del devnameRemove the USB device @var{devname} from the QEMU virtual USBhub. @var{devname} has the syntax @code{bus.addr}. Use the monitorcommand @code{info usb} to see the devices you can remove.@end table@subsection Integer expressionsThe monitor understands integers expressions for every integerargument. You can use register names to get the value of specificsCPU registers by prefixing them with @emph{$}.@node disk_images@section Disk ImagesSince version 0.6.1, QEMU supports many disk image formats, includinggrowable disk images (their size increase as non empty sectors arewritten), compressed and encrypted disk images.@menu* disk_images_quickstart:: Quick start for disk image creation* disk_images_snapshot_mode:: Snapshot mode* qemu_img_invocation:: qemu-img Invocation* disk_images_fat_images:: Virtual FAT disk images@end menu@node disk_images_quickstart@subsection Quick start for disk image creationYou can create a disk image with the command:@exampleqemu-img create myimage.img mysize@end examplewhere @var{myimage.img} is the disk image filename and @var{mysize} is itssize in kilobytes. You can add an @code{M} suffix to give the size inmegabytes and a @code{G} suffix for gigabytes.See @ref{qemu_img_invocation} for more information.@node disk_images_snapshot_mode@subsection Snapshot modeIf you use the option @option{-snapshot}, all disk images areconsidered as read only. When sectors in written, they are written ina temporary file created in @file{/tmp}. You can however force thewrite back to the raw disk images by using the @code{commit} monitorcommand (or @key{C-a s} in the serial console).@node qemu_img_invocation@subsection @code{qemu-img} Invocation@include qemu-img.texi@node disk_images_fat_images@subsection Virtual FAT disk imagesQEMU can automatically create a virtual FAT disk image from adirectory tree. In order to use it, just type:@example qemu linux.img -hdb fat:/my_directory@end exampleThen you access access to all the files in the @file{/my_directory}directory without having to copy them in a disk image or to exportthem via SAMBA or NFS. The default access is @emph{read-only}.Floppies can be emulated with the @code{:floppy:} option:@example qemu linux.img -fda fat:floppy:/my_directory@end exampleA read/write support is available for testing (beta stage) with the@code{:rw:} option:@example qemu linux.img -fda fat:floppy:rw:/my_directory@end exampleWhat you should @emph{never} do:@itemize@item use non-ASCII filenames ;@item use "-snapshot" together with ":rw:" ;@item expect it to work when loadvm'ing ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -