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

📄 qemu-doc.html

📁 qemu虚拟机代码
💻 HTML
📖 第 1 页 / 共 5 页
字号:
               -net nic,vlan=1 -net tap,vlan=1,ifname=tap1</PRE><DT><SAMP>`-net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]'</SAMP><DD>Connect the VLAN <VAR>n</VAR> to a remote VLAN in another QEMU virtualmachine using a TCP socket connection. If <SAMP>`listen'</SAMP> isspecified, QEMU waits for incoming connections on <VAR>port</VAR>(<VAR>host</VAR> is optional). <SAMP>`connect'</SAMP> is used to connect toanother QEMU instance using the <SAMP>`listen'</SAMP> option. <SAMP>`fd=h'</SAMP>specifies an already opened TCP socket.Example:<PRE># 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</PRE><DT><SAMP>`-net socket[,vlan=n][,fd=h][,mcast=maddr:port]'</SAMP><DD>Create a VLAN <VAR>n</VAR> shared with another QEMU virtualmachines using a UDP multicast socket, effectively making a bus for every QEMU with same multicast address <VAR>maddr</VAR> and <VAR>port</VAR>.NOTES:<OL><LI>Several QEMU can be running on different hosts and share same bus (assuming correct multicast setup for these hosts).<LI>mcast support is compatible with User Mode Linux (argument <SAMP>`eth<VAR>N</VAR>=mcast'</SAMP>), see<A HREF="http://user-mode-linux.sf.net">http://user-mode-linux.sf.net</A>.<LI>Use <SAMP>`fd=h'</SAMP> to specify an already opened UDP multicast socket.</OL>Example:<PRE># 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</PRE>Example (User Mode Linux compat.):<PRE># 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</PRE><DT><SAMP>`-net none'</SAMP><DD>Indicate that no network devices should be configured. It is used tooverride the default configuration (<SAMP>`-net nic -net user'</SAMP>) whichis activated if no <SAMP>`-net'</SAMP> options are provided.<DT><SAMP>`-tftp prefix'</SAMP><DD>When using the user mode network stack, activate a built-in TFTPserver. All filenames beginning with <VAR>prefix</VAR> 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</CODE> ofthe Unix TFTP client). The host IP address on the guest is as usual10.0.2.2.<DT><SAMP>`-smb dir'</SAMP><DD>When using the user mode network stack, activate a built-in SMBserver so that Windows OSes can access to the host files in <TT>`dir'</TT>transparently.In the guest Windows OS, the line:<PRE>10.0.2.4 smbserver</PRE>must be added in the file <TT>`C:\WINDOWS\LMHOSTS'</TT> (for windows 9x/Me)or <TT>`C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS'</TT> (Windows NT/2000).Then <TT>`dir'</TT> can be accessed in <TT>`\\smbserver\qemu'</TT>.Note that a SAMBA server must be installed on the host OS in<TT>`/usr/sbin/smbd'</TT>. 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.<DT><SAMP>`-redir [tcp|udp]:host-port:[guest-host]:guest-port'</SAMP><DD>When using the user mode network stack, redirect incoming TCP or UDPconnections to the host port <VAR>host-port</VAR> to the guest<VAR>guest-host</VAR> on guest port <VAR>guest-port</VAR>. If <VAR>guest-host</VAR>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:<PRE># on the hostqemu -redir tcp:6001::6000 [...]# this host xterm should open in the guest X11 serverxterm -display :1</PRE>To redirect telnet connections from host port 5555 to telnet port onthe guest, use the following:<PRE># on the hostqemu -redir tcp:5555::23 [...]telnet localhost 5555</PRE>Then when you use on the host <CODE>telnet localhost 5555</CODE>, youconnect to the guest telnet server.</DL><P>Linux 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.<DL COMPACT><DT><SAMP>`-kernel bzImage'</SAMP><DD>Use <VAR>bzImage</VAR> as kernel image.<DT><SAMP>`-append cmdline'</SAMP><DD>Use <VAR>cmdline</VAR> as kernel command line<DT><SAMP>`-initrd file'</SAMP><DD>Use <VAR>file</VAR> as initial ram disk.</DL><P>Debug/Expert options:<DL COMPACT><DT><SAMP>`-serial dev'</SAMP><DD>Redirect the virtual serial port to host device <VAR>dev</VAR>. Availabledevices are:<DL COMPACT><DT><CODE>vc</CODE><DD>Virtual console<DT><CODE>pty</CODE><DD>[Linux only] Pseudo TTY (a new PTY is automatically allocated)<DT><CODE>null</CODE><DD>void device<DT><CODE>/dev/XXX</CODE><DD>[Linux only] Use host tty, e.g. <TT>`/dev/ttyS0'</TT>. The host serial portparameters are set according to the emulated ones.<DT><CODE>/dev/parportN</CODE><DD>[Linux only, parallel port only] Use host parallel port<VAR>N</VAR>. Currently only SPP parallel port features can be used.<DT><CODE>file:filename</CODE><DD>Write output to filename. No character can be read.<DT><CODE>stdio</CODE><DD>[Unix only] standard input/output<DT><CODE>pipe:filename</CODE><DD>[Unix only] name pipe <VAR>filename</VAR></DL>The default device is <CODE>vc</CODE> in graphical mode and <CODE>stdio</CODE> innon graphical mode.This option can be used several times to simulate up to 4 serialsports.<DT><SAMP>`-parallel dev'</SAMP><DD>Redirect the virtual parallel port to host device <VAR>dev</VAR> (samedevices as the serial port). On Linux hosts, <TT>`/dev/parportN'</TT> 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.<DT><SAMP>`-monitor dev'</SAMP><DD>Redirect the monitor to host device <VAR>dev</VAR> (same devices as theserial port).The default device is <CODE>vc</CODE> in graphical mode and <CODE>stdio</CODE> innon graphical mode.<DT><SAMP>`-s'</SAMP><DD>Wait gdb connection to port 1234 (see section <A HREF="qemu-doc.html#SEC29">3.10 GDB usage</A>). <DT><SAMP>`-p port'</SAMP><DD>Change gdb connection port.<DT><SAMP>`-S'</SAMP><DD>Do not start CPU at startup (you must type 'c' in the monitor).<DT><SAMP>`-d'</SAMP><DD>Output log in /tmp/qemu.log<DT><SAMP>`-hdachs c,h,s,[,t]'</SAMP><DD>Force hard disk 0 physical geometry (1 &#60;= <VAR>c</VAR> &#60;= 16383, 1 &#60;=<VAR>h</VAR> &#60;= 16, 1 &#60;= <VAR>s</VAR> &#60;= 63) and optionally force the BIOStranslation mode (<VAR>t</VAR>=none, lba or auto). Usually QEMU can guessall thoses parameters. This option is useful for old MS-DOS diskimages.<DT><SAMP>`-std-vga'</SAMP><DD>Simulate a standard VGA card with Bochs VBE extensions (default isCirrus Logic GD5446 PCI VGA)<DT><SAMP>`-loadvm file'</SAMP><DD>Start right away with a saved state (<CODE>loadvm</CODE> in monitor)</DL><H2><A NAME="SEC11" HREF="qemu-doc.html#TOC11">3.4 Keys</A></H2><P>During the graphical emulation, you can use the following keys:<DL COMPACT><DT><KBD>Ctrl-Alt-f</KBD><DD>Toggle full screen<DT><KBD>Ctrl-Alt-n</KBD><DD>Switch to virtual console 'n'. Standard console mappings are:<DL COMPACT><DT><EM>1</EM><DD>Target system display<DT><EM>2</EM><DD>Monitor<DT><EM>3</EM><DD>Serial port</DL><DT><KBD>Ctrl-Alt</KBD><DD>Toggle mouse and keyboard grab.</DL><P>In the virtual consoles, you can use <KBD>Ctrl-Up</KBD>, <KBD>Ctrl-Down</KBD>,<KBD>Ctrl-PageUp</KBD> and <KBD>Ctrl-PageDown</KBD> to move in the back log.<P>During emulation, if you are using the <SAMP>`-nographic'</SAMP> option, use<KBD>Ctrl-a h</KBD> to get terminal commands:<DL COMPACT><DT><KBD>Ctrl-a h</KBD><DD>Print this help<DT><KBD>Ctrl-a x</KBD><DD>Exit emulatior<DT><KBD>Ctrl-a s</KBD><DD>Save disk data back to file (if -snapshot)<DT><KBD>Ctrl-a b</KBD><DD>Send break (magic sysrq in Linux)<DT><KBD>Ctrl-a c</KBD><DD>Switch between console and monitor<DT><KBD>Ctrl-a Ctrl-a</KBD><DD>Send Ctrl-a</DL><H2><A NAME="SEC12" HREF="qemu-doc.html#TOC12">3.5 QEMU Monitor</A></H2><P>The QEMU monitor is used to give complex commands to the QEMUemulator. You can use it to:<UL><LI>Remove or insert removable medias images(such as CD-ROM or floppies)<LI>Freeze/unfreeze the Virtual Machine (VM) and save or restore its statefrom a disk file.<LI>Inspect the VM state without an external debugger.</UL><H3><A NAME="SEC13" HREF="qemu-doc.html#TOC13">3.5.1 Commands</A></H3><P>The following commands are available:<DL COMPACT><DT><SAMP>`help or ? [cmd]'</SAMP><DD>Show the help for all commands or just for command <VAR>cmd</VAR>.<DT><SAMP>`commit'</SAMP><DD>Commit changes to the disk images (if -snapshot is used)<DT><SAMP>`info subcommand'</SAMP><DD>show various information about the system state<DL COMPACT><DT><SAMP>`info network'</SAMP><DD>show the various VLANs and the associated devices<DT><SAMP>`info block'</SAMP><DD>show the block devices<DT><SAMP>`info registers'</SAMP><DD>show the cpu registers<DT><SAMP>`info history'</SAMP><DD>show the command line history<DT><SAMP>`info pci'</SAMP><DD>show emulated PCI device<DT><SAMP>`info usb'</SAMP><DD>show USB devices plugged on the virtual USB hub<DT><SAMP>`info usbhost'</SAMP><DD>show all USB host devices</DL><DT><SAMP>`q or quit'</SAMP><DD>Quit the emulator.<DT><SAMP>`eject [-f] device'</SAMP><DD>Eject a removable media (use -f to force it).<DT><SAMP>`change device filename'</SAMP><DD>Change a removable media.<DT><SAMP>`screendump filename'</SAMP><DD>Save screen into PPM image <VAR>filename</VAR>.<DT><SAMP>`log item1[,...]'</SAMP><DD>Activate logging of the specified items to <TT>`/tmp/qemu.log'</TT>.<DT><SAMP>`savevm filename'</SAMP><DD>Save the whole virtual machine state to <VAR>filename</VAR>.<DT><SAMP>`loadvm filename'</SAMP><DD>Restore the whole virtual machine state from <VAR>filename</VAR>.<DT><SAMP>`stop'</SAMP><DD>Stop emulation.<DT><SAMP>`c or cont'</SAMP><DD>Resume emulation.<DT><SAMP>`gdbserver [port]'</SAMP><DD>Start gdbserver session (default port=1234)<DT><SAMP>`x/fmt addr'</SAMP><DD>Virtual memory dump starting at <VAR>addr</VAR>.<DT><SAMP>`xp /fmt addr'</SAMP><DD>Physical memory dump starting at <VAR>addr</VAR>.<VAR>fmt</VAR> is a format which tells the command how to format thedata. Its syntax is: <SAMP>`/{count}{format}{size}'</SAMP><DL COMPACT><DT><VAR>count</VAR><DD>is the number of items to be dumped.<DT><VAR>format</VAR><DD>can be x (hexa), d (signed decimal), u (unsigned decimal), o (octal),c (char) or i (asm instruction).<DT><VAR>size</VAR><DD>can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,<CODE>h</CODE> or <CODE>w</CODE> can be specified with the <CODE>i</CODE> format torespectively select 16 or 32 bit code instruction size.</DL>Examples: <UL><LI>Dump 10 instructions at the current instruction pointer:<PRE>(qemu) x/10i $eip0x90107063:  ret0x90107064:  sti0x90107065:  lea    0x0(%esi,1),%esi0x90107069:  lea    0x0(%edi,1),%edi0x90107070:  ret0x90107071:  jmp    0x901070800x90107073:  nop0x90107074:  nop0x90107075:  nop0x90107076:  nop</PRE><LI>

⌨️ 快捷键说明

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