配置Windows主机与Ubuntu虚拟机间的串口COM端口连接
Hey there! Let's work through this serial communication challenge you're facing with your Samsung Artik710 (running Ubuntu) in VirtualBox—especially since your go-to serial app only works on Windows. I’ve got a few practical solutions based on your mention of trying virtual ports, plus some alternatives to make this smoother:
Since you already started with virtual ports, let’s refine that approach using a virtual serial pair and VirtualBox’s pipe mapping:
- First, on your Windows system (whether it’s your physical host or a Windows VM in VirtualBox), install a tool like com0com to create a paired set of virtual serial ports (e.g., COM3 ↔ COM4). These ports act as a bridge—data sent to one goes straight to the other.
- For your Ubuntu VM in VirtualBox:
- Shut down the VM first (settings won’t apply if it’s running).
- Go to Settings → Ports → Serial Ports.
- Check "Enable Serial Port", set the port number to
COM1(this maps to/dev/ttyS0in Ubuntu). - Under "Port Mode", select Host Pipe, then enter a pipe path like
\\.\pipe\artik_serial(Windows-style path if your host is Windows, or/tmp/artik_serialif your host is Linux). - Toggle "Create Pipe" if it’s not already checked, then save settings.
- Back on Windows, configure one of your com0com virtual ports (e.g., COM4) to connect to that same pipe. Now, when you open COM3 in your Windows serial app, it’ll talk directly to
/dev/ttyS0in your Ubuntu VM.
If your Samsung Artik710 is connected to your host machine via a physical RS232/USB-serial adapter, you can pass that device straight to your Ubuntu VM:
- Shut down the Ubuntu VM.
- Open VirtualBox Settings → Ports → Serial Ports.
- Check "Enable Serial Port", set port number to
COM1. - Under "Port Mode", select Host Device, then pick your physical serial adapter from the dropdown list (it’ll look like
/dev/ttyUSB0on Linux hosts or a COM port on Windows hosts). - Boot up the Ubuntu VM, then run
ls /dev/tty*to confirm the device is visible. You may need to add your user to thedialoutgroup first to access it:
Log out and back in for this change to take effect.sudo usermod -aG dialout $USER
If you’d rather avoid juggling VMs and virtual ports, Ubuntu has great native tools that can replace your Windows serial app:
- screen: A lightweight command-line tool. Install it with
sudo apt install screen, then connect to your serial port with:
(Replacescreen /dev/ttyS0 9600 8N1/dev/ttyS0with your actual device,9600with your baud rate, and8N1with your data/parity/stop bit settings.) - minicom: A more feature-rich CLI tool with menus for configuration. Install with
sudo apt install minicom, then runsudo minicom -sto set up your port settings. - gtkterm: A graphical serial tool if you prefer a GUI. Install with
sudo apt install gtkterm, then select your port and configure parameters from the menu.
- Always double-check that your serial parameters (baud rate, data bits, stop bits, parity) match exactly between your app/tool and the Artik710—mismatches cause garbled data or no communication at all.
- If you’re having trouble seeing the serial device in Ubuntu, run
dmesg | grep ttyright after plugging in the adapter—it’ll show you the device path.
内容的提问来源于stack exchange,提问作者Itay Almani

