VirtualBox

source: vbox/trunk/doc/manual/en_US/dita/topics/serialports.dita@ 106807

最後變更 在這個檔案從106807是 105841,由 vboxsync 提交於 6 月 前

Docs: bugref:10705. The following commits from doc's team git repo has been applied:

24b92cd60f8a5bbffa8f66258d78050cfb0a6de2 Included review feedback on several topics

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 8.5 KB
 
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
3<topic xml:lang="en-us" id="serialports">
4 <title>Serial Ports</title>
5
6 <body>
7 <p><ph conkeyref="vbox-conkeyref-phrases/product-name"/> supports the use of virtual serial ports in a virtual machine with an x86 architecture. Serial ports are not available on Arm VMs.</p>
8 <p>Ever since the original IBM PC, personal computers have been equipped with one or two serial ports, also called
9 COM ports by DOS and Windows. Serial ports were commonly used with modems, and some computer mice used to be
10 connected to serial ports before USB became commonplace. </p>
11 <p>While serial ports are no longer as common as they used to be, there are still some important uses left for them.
12 For example, serial ports can be used to set up a primitive network over a null-modem cable, in case Ethernet is
13 not available. Also, serial ports are indispensable for system programmers needing to do kernel debugging, since
14 kernel debugging software usually interacts with developers over a serial port. With virtual serial ports, system
15 programmers can do kernel debugging on a virtual machine instead of needing a real computer to connect to. </p>
16 <p>If a virtual serial port is enabled, the guest OS sees a standard 16550A compatible UART device. Other UART types
17 can be configured using the <userinput>VBoxManage modifyvm</userinput> command. Both receiving and transmitting
18 data is supported. How this virtual serial port is then connected to the host is configurable, and the details
19 depend on your host OS. </p>
20 <p>You can use either the Settings tabs or the <userinput>VBoxManage</userinput> command to set up virtual serial
21 ports. For the latter, see <xref href="vboxmanage-modifyvm.dita"/> for information on the <codeph>--uart</codeph>,
22 <codeph>--uart-mode</codeph> and <codeph>--uart-type</codeph> options. </p>
23 <p>You can configure up to four virtual serial ports per virtual machine. For each device, you must set the
24 following: </p>
25 <ol>
26 <li>
27 <p><b outputclass="bold">Port Number:</b> This determines
28 the serial port that the virtual machine should see. For best
29 results, use the traditional values as follows:
30 </p>
31 <ul>
32 <li>
33 <p>
34 COM1: I/O base 0x3F8, IRQ 4
35 </p>
36 </li>
37 <li>
38 <p>
39 COM2: I/O base 0x2F8, IRQ 3
40 </p>
41 </li>
42 <li>
43 <p>
44 COM3: I/O base 0x3E8, IRQ 4
45 </p>
46 </li>
47 <li>
48 <p>
49 COM4: I/O base 0x2E8, IRQ 3
50 </p>
51 </li>
52 </ul>
53 <p>
54 You can also configure a user-defined serial port. Enter an
55 I/O base address and interrupt (IRQ).
56 </p>
57 </li>
58 <li>
59 <p><b outputclass="bold">Port Mode:</b> What the virtual
60 port is connected to. For each virtual serial port, you have
61 the following options:
62 </p>
63 <ul>
64 <li>
65 <p><b outputclass="bold">Disconnected:</b> The guest
66 will see the device, but it will behave as if no cable had
67 been connected to it.
68 </p>
69 </li>
70 <li>
71 <p><b outputclass="bold">Host Device:</b> Connects the
72 virtual serial port to a physical serial port on your
73 host. On a Windows host, this will be a name like
74 <codeph>COM1</codeph>. On Linux or Oracle Solaris hosts,
75 it will be a device node like
76 <filepath>/dev/ttyS0</filepath>. <ph conkeyref="vbox-conkeyref-phrases/product-name"/> will then
77 simply redirect all data received from and sent to the
78 virtual serial port to the physical device.
79 </p>
80 </li>
81 <li>
82 <p><b outputclass="bold">Host Pipe:</b> Configure
83 <ph conkeyref="vbox-conkeyref-phrases/product-name"/> to connect the virtual serial port to a
84 software pipe on the host. This depends on your host OS,
85 as follows:
86 </p>
87 <ul>
88 <li>
89 <p>On a Windows host, data will be sent and received through a named pipe. The pipe name must be in the
90 format <filepath>\\.\pipe\<varname>name</varname>
91 </filepath> where <varname>name</varname> should identify the virtual machine but may be freely
92 chosen. </p>
93 </li>
94 <li>
95 <p>On a Mac OS, Linux, or Oracle Solaris host, a local domain socket is used instead. The socket
96 filename must be chosen such that the user running <ph conkeyref="vbox-conkeyref-phrases/product-name"
97 /> has sufficient privileges to create and write to it. The <filepath>/tmp</filepath> directory is
98 often a good candidate. </p>
99 <p>On Linux there are various tools which can connect to a local domain socket or create one in server
100 mode. The most flexible tool is <userinput>socat</userinput> and is available as part of many
101 distributions. </p>
102 </li>
103 </ul>
104 <p>In this case, you can configure whether <ph conkeyref="vbox-conkeyref-phrases/product-name"/> should
105 create the named pipe, or the local domain socket on non-Windows hosts, itself or whether <ph
106 conkeyref="vbox-conkeyref-phrases/product-name"/> should assume that the pipe or socket exists already.
107 With the <userinput>VBoxManage</userinput> command-line options, this is referred to as server mode or
108 client mode, respectively. </p>
109 <p>For a direct connection between two virtual machines, corresponding to a null-modem cable, simply
110 configure one VM to create a pipe or socket and another to attach to it. </p>
111 </li>
112 <li>
113 <p><b outputclass="bold">Raw File:</b> Send the
114 virtual serial port output to a file. This option is very
115 useful for capturing diagnostic output from a guest. Any
116 file may be used for this purpose, as long as the user
117 running <ph conkeyref="vbox-conkeyref-phrases/product-name"/> has sufficient privileges to create
118 and write to the file.
119 </p>
120 </li>
121 <li>
122 <p><b outputclass="bold">TCP:</b> Useful for
123 forwarding serial traffic over TCP/IP, acting as a server,
124 or it can act as a TCP client connecting to other servers.
125 This option enables a remote machine to directly connect
126 to the guest's serial port using TCP.
127 </p>
128 <ul>
129 <li>
130 <p><b outputclass="bold">TCP Server:</b> Deselect
131 the <b outputclass="bold">Connect to Existing
132 Pipe/Socket</b> check box and specify the port
133 number in the
134 <b outputclass="bold">Path/Address</b> field.
135 This is typically 23 or 2023. Note that on UNIX-like
136 systems you will have to use a port a number greater
137 than 1024 for regular users.
138 </p>
139 <p>The client can use software such as <userinput>PuTTY</userinput> or the <userinput>telnet</userinput>
140 command line tool to access the TCP Server. </p>
141 </li>
142 <li>
143 <p><b outputclass="bold">TCP Client:</b> To create
144 a virtual null-modem cable over the Internet or LAN,
145 the other side can connect using TCP by specifying
146 <codeph><varname>hostname</varname>:<varname>port</varname></codeph>
147 in the <b outputclass="bold">Path/Address</b>
148 field. The TCP socket will act in client mode if you
149 select the <b outputclass="bold">Connect to Existing
150 Pipe/Socket</b> check box.
151 </p>
152 </li>
153 </ul>
154 </li>
155 </ul>
156 </li>
157 </ol>
158 <p>Up to four serial ports can be configured per virtual machine, but you can pick any port numbers out of the
159 above. However, serial ports cannot reliably share interrupts. If both ports are to be used at the same time, they
160 must use different interrupt levels, for example COM1 and COM2, but not COM1 and COM3. </p>
161 </body>
162
163</topic>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette