⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qemu-doc.texi

📁 qemu虚拟机代码
💻 TEXI
📖 第 1 页 / 共 4 页
字号:
\input texinfo @c -*- texinfo -*-@c %**start of header@setfilename qemu-doc.info@settitle QEMU CPU Emulator User Documentation@exampleindent 0@paragraphindent 0@c %**end of header@iftex@titlepage@sp 7@center @titlefont{QEMU CPU Emulator}@sp 1@center @titlefont{User Documentation}@sp 3@end titlepage@end iftex@ifnottex@node Top@top@menu* Introduction::* Installation::* QEMU PC System emulator::* QEMU System emulator for non PC targets::* QEMU Linux User space emulator::* compilation:: Compilation from the sources* Index::@end menu@end ifnottex@contents@node Introduction@chapter Introduction@menu* intro_features:: Features@end menu@node intro_features@section FeaturesQEMU is a FAST! processor emulator using dynamic translation toachieve good emulation speed.QEMU has two operating modes:@itemize @minus@item Full system emulation. In this mode, QEMU emulates a full system (forexample a PC), including one or several processors and variousperipherals. It can be used to launch different Operating Systemswithout rebooting the PC or to debug system code.@item User mode emulation (Linux host only). In this mode, QEMU can launchLinux processes compiled for one CPU on another CPU. It can be used tolaunch the Wine Windows API emulator (@url{http://www.winehq.org}) orto ease cross-compilation and cross-debugging.@end itemizeQEMU can run without an host kernel driver and yet gives acceptableperformance. For system emulation, the following hardware targets are supported:@itemize@item PC (x86 or x86_64 processor)@item ISA PC (old style PC without PCI bus)@item PREP (PowerPC processor)@item G3 BW PowerMac (PowerPC processor)@item Mac99 PowerMac (PowerPC processor, in progress)@item Sun4m (32-bit Sparc processor)@item Sun4u (64-bit Sparc processor, in progress)@item Malta board (32-bit MIPS processor)@item ARM Integrator/CP (ARM926E or 1026E processor)@end itemizeFor user emulation, x86, PowerPC, ARM, MIPS, and Sparc32/64 CPUs are supported.@node Installation@chapter InstallationIf you want to compile QEMU yourself, see @ref{compilation}.@menu* install_linux::   Linux* install_windows:: Windows* install_mac::     Macintosh@end menu@node install_linux@section LinuxIf a precompiled package is available for your distribution - you justhave to install it. Otherwise, see @ref{compilation}.@node install_windows@section WindowsDownload the experimental binary installer at@url{http://www.free.oszoo.org/@/download.html}.@node install_mac@section Mac OS XDownload the experimental binary installer at@url{http://www.free.oszoo.org/@/download.html}.@node QEMU PC System emulator@chapter QEMU PC System emulator@menu* pcsys_introduction:: Introduction* pcsys_quickstart::   Quick Start* sec_invocation::     Invocation* pcsys_keys::         Keys* pcsys_monitor::      QEMU Monitor* disk_images::        Disk Images* pcsys_network::      Network emulation* direct_linux_boot::  Direct Linux Boot* pcsys_usb::          USB emulation* gdb_usage::          GDB usage* pcsys_os_specific::  Target OS specific information@end menu@node pcsys_introduction@section Introduction@c man begin DESCRIPTIONThe QEMU PC System emulator simulates thefollowing peripherals:@itemize @minus@item i440FX host PCI bridge and PIIX3 PCI to ISA bridge@itemCirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESAextensions (hardware level, including all non standard modes).@itemPS/2 mouse and keyboard@item 2 PCI IDE interfaces with hard disk and CD-ROM support@itemFloppy disk@item NE2000 PCI network adapters@itemSerial ports@itemCreative SoundBlaster 16 sound card@itemENSONIQ AudioPCI ES1370 sound card@itemAdlib(OPL2) - Yamaha YM3812 compatible chip@itemPCI UHCI USB controller and a virtual USB hub.@end itemizeSMP is supported with up to 255 CPUs.Note that adlib is only available when QEMU was configured with-enable-adlibQEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPLVGA BIOS.QEMU uses YM3812 emulation by Tatsuyuki Satoh.@c man end@node pcsys_quickstart@section Quick StartDownload and uncompress the linux image (@file{linux.img}) and type:@exampleqemu linux.img@end exampleLinux should boot and give you a prompt.@node sec_invocation@section Invocation@example@c man begin SYNOPSISusage: qemu [options] [disk_image]@c man end@end example@c man begin OPTIONS@var{disk_image} is a raw hard disk image for IDE hard disk 0.General options:@table @option@item -M machineSelect the emulated machine (@code{-M ?} for list)@item -fda file@item -fdb fileUse @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You canuse the host floppy by using @file{/dev/fd0} as filename.@item -hda file@item -hdb file@item -hdc file@item -hdd fileUse @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).@item -cdrom fileUse @var{file} as CD-ROM image (you cannot use @option{-hdc} and and@option{-cdrom} at the same time). You can use the host CD-ROM byusing @file{/dev/cdrom} as filename.@item -boot [a|c|d]Boot on floppy (a), hard disk (c) or CD-ROM (d). Hard disk boot isthe default.@item -snapshotWrite to temporary files instead of disk image files. In this case,the raw disk image you use is not written back. You can however forcethe write back by pressing @key{C-a s} (@pxref{disk_images}). @item -m megsSet virtual RAM size to @var{megs} megabytes. Default is 128 MB.@item -smp nSimulate an SMP system with @var{n} CPUs. On the PC target, up to 255CPUs are supported.@item -nographicNormally, QEMU uses SDL to display the VGA output. With this option,you can totally disable graphical output so that QEMU is a simplecommand line application. The emulated serial port is redirected onthe console. Therefore, you can still use QEMU to debug a Linux kernelwith a serial console.@item -vnc dNormally, QEMU uses SDL to display the VGA output.  With this option,you can have QEMU listen on VNC display d and redirect the VGA displayover the VNC session.  It is very useful to enable the usb tablet devicewhen using this option (option @option{-usbdevice tablet}).@item -k languageUse keyboard layout @var{language} (for example @code{fr} forFrench). This option is only needed where it is not easy to get raw PCkeycodes (e.g. on Macs or with some X11 servers). You don't need touse it on PC/Linux or PC/Windows hosts.The available layouts are:@examplear  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  svda  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     thde  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr@end exampleThe default is @code{en-us}.@item -audio-helpWill show the audio subsystem help: list of drivers, tunableparameters.@item -soundhw card1,card2,... or -soundhw allEnable audio and selected sound hardware. Use ? to print allavailable sound hardware.@exampleqemu -soundhw sb16,adlib hdaqemu -soundhw es1370 hdaqemu -soundhw all hdaqemu -soundhw ?@end example@item -localtimeSet the real time clock to local time (the default is to UTCtime). This option is needed to have correct date in MS-DOS orWindows.@item -full-screenStart in full screen.@item -pidfile fileStore the QEMU process PID in @var{file}. It is useful if you launch QEMUfrom a script.@item -win2k-hackUse it when installing Windows 2000 to avoid a disk full bug. AfterWindows 2000 is installed, you no longer need this option (this optionslows down the IDE transfers).@end tableUSB options:@table @option@item -usbEnable the USB driver (will be the default soon)@item -usbdevice devnameAdd the USB device @var{devname}. See the monitor command@code{usb_add} to have more information.@end tableNetwork options:@table @option@item -net nic[,vlan=n][,macaddr=addr][,model=type]Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}= 0 is the default). The NIC is currently an NE2000 on the PCtarget. Optionally, the MAC address can be changed. 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{ne2k_pci}, @code{ne2k_isa}, @code{rtl8139},@code{smc91c111} and @code{lance}.  Not all devices are supported on alltargets.@item -net user[,vlan=n][,hostname=name]Use the user mode network stack which requires no administratorpriviledge to run.  @option{hostname=name} can be used to specify the clienthostname reported by the builtin DHCP server.@item -net tap[,vlan=n][,fd=h][,ifname=name][,script=file]Connect the host TAP network interface @var{name} to VLAN @var{n} anduse the network script @var{file} to configure it. The defaultnetwork script is @file{/etc/qemu-ifup}. If @var{name} is notprovided, the OS automatically provides one.  @option{fd=h} can beused to specify the handle of an already opened host TAP interface. Example:@exampleqemu linux.img -net nic -net tap@end exampleMore complicated example (two NICs, each one connected to a TAP device)@exampleqemu 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=n][,fd=h][,listen=[host]:port][,connect=host:port]Connect the VLAN @var{n} to a remote VLAN in another QEMU virtualmachine using a TCP socket connection. If @option{listen} isspecified, QEMU waits for incoming connections on @var{port}(@var{host} is optional). @option{connect} is used to connect toanother QEMU instance using the @option{listen} option. @option{fd=h}specifies an already opened TCP socket.Example:@example# launch a first QEMU instanceqemu 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 instanceqemu 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=n][,fd=h][,mcast=maddr:port]Create a VLAN @var{n} shared with another QEMU virtualmachines 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).@itemmcast 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 enumerateExample:@example# launch one QEMU instanceqemu 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 exampleExample (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 noneIndicate that no network devices should be configured. It is used tooverride the default configuration (@option{-net nic -net user}) whichis activated if no @option{-net} options are provided.@item -tftp prefixWhen using the user mode network stack, activate a built-in TFTPserver. All filenames beginning with @var{prefix} can be downloadedfrom the host to the guest using a TFTP client. The TFTP client on theguest must be configured in binary mode (use the command @code{bin} ofthe Unix TFTP client). The host IP address on the guest is as usual10.0.2.2.@item -smb dirWhen using the user mode network stack, activate a built-in SMBserver so that Windows OSes can access to the host files in @file{dir}transparently.In the guest Windows OS, the line:@example10.0.2.4 smbserver@end examplemust 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{dir} can be accessed in @file{\\smbserver\qemu}.Note that a SAMBA server must be installed on the host OS in

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -