Enable Serial Terminal for Ubuntu/Linux VM
Enabling a serial terminal for Ubuntu or Linux VMs allows you to access the VM console via a serial port, which is supported by most hypervisors (Proxmox, VMware, VirtualBox, etc.). This guide walks you through the process.
Prerequisites
- A hypervisor (Proxmox, VMware, VirtualBox, etc.) with an Ubuntu/Linux VM
- Access to the VM via SSH or Console
Steps
1. Add a Virtual Serial Port
- Open your hypervisor's management interface.
- Select your VM.
- Add a Serial Port to the VM hardware.
- Confirm and restart the VM if required.
2. Enable Serial Console in Ubuntu/Linux
-
Log in to your Ubuntu/Linux VM (via SSH or Console).
-
Enable and start the serial-getty service for the serial port (usually
ttyS0):sudo systemctl enable serial-getty@ttyS0.service
sudo systemctl start serial-getty@ttyS0.serviceinfoSingle command alternative:
sudo systemctl enable --now serial-getty@ttyS0.serviceIf your serial port uses a different device (e.g.,
ttyS1), adjust the command accordingly.
3. Access the Serial Terminal
- Use your hypervisor's console feature (e.g., xterm.js in Proxmox, Serial Console in VMware/VirtualBox).
- You should now see the Ubuntu/Linux login prompt via the serial terminal.
Example: Proxmox VE
If you are using Proxmox VE, follow these steps:
- Open the Proxmox Web GUI.
- Select your VM.
- Go to Hardware.
- Click Add → Serial Port.
- Confirm and restart the VM.
- After enabling the serial-getty service as described above, go to Console and select xterm.js.
- You should see the Ubuntu/Linux login prompt via the serial terminal.