Proxmox Copy & Paste
How do you make "Copy and Paste" work in your VM.
One annoying issue is the sometimes working and sometimes not working Copy & Paste.
Add a Serial port
We need to add serial0 to the virtual machine, there are two ways to do it:
If you want Copy/Paste, do:
VM→Hardware→ hitAdd→ selectSerial PortVM→Hardware→Display→ Edit Display: Graphic card:Serial terminal 0
Or the by
- Use the following command to add the
serial0-port qm set [vmid] -serial0 socket- Use the Proxmox VE web GUI
Go toDatacenter→node name/cluster name→VM ID→Hardware→ hitAdd→ selectSerial Port VM→Hardware→Display→ Edit Display: Graphic card:Serial terminal 0
Old way for GRUB-based
For systems based on Debian and RHEL
Depending on your VM OS
- Debian/Ubuntu/Kali Linux etc.:
update-grub - RHEL/CentOS/Fedora:
grub2-mkconfig --output=/boot/grub2/grub.cfg - NOT Alpine with Grub, see the Alpine section!
Restart the VM
Restart the virtual machine, when it’s booted, launch xterm.js, Press Enter multiple times, we now should have connected to the virtual machine with xterm.js successfully
Modify GRUB
Edit /etc/default/grub -file as root or use sudo by running this command:
sudo sh -c 'echo 'GRUB_CMDLINE_LINUX="quiet console=tty0 console=ttyS0,115200"' >> /etc/default/grub'Or you can edit the file manually nano /etc/default/grub,
Find the line with “GRUB_CMDLINE_LINUX”
Add the necessary part: console=tty0 console=ttyS0,115200
Update GRUB
Depending on your VM OS
- Debian/Ubuntu/Kali Linux etc.:
update-grub - RHEL/CentOS/Fedora:
grub2-mkconfig --output=/boot/grub2/grub.cfg
Restart the VM
Restart the virtual machine, when it’s booted, launch xterm.js, Press Enter multiple times, we now should have connected to the virtual machine with xterm.js successfully
Alpine
We need agetty, and have it running.
- Install by
doas apk add agetty- and
doas rc-update addd agetty default
- and
- Status:
doas rc-service agetty status - Start:
-
doas rc-service agetty start -
doas rc-service agetty.ttyS0 start
-
Edit /etc/inittab
Start by editing doas vi /etc/inittab and look for lines like tty1::respawn:/sbin/getty 38400 tty1. Un comment or add serial console line
ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
ttyS0 → serial device
115200 → baud rate (match your VM)
vt100 → safe terminal type
Tell init to reload inittab
Finalize it by sudo kill -HUP 1. No reboot needed.
Edit extlinux.conf
We will need to append to the file: doas vi /boot/extlinux.cfg.
- Look for or add the line starting with
APPEND root=- append
console=tty0 console=ttyS0,115200to the end.
- append
Ensure kernel console output goes to serial – Critical
Without this, login may succeed, but you won’t see it.
Check it by: cat /proc/cmdline.
You should see something like: console=ttyS0,115200.
If not, add it doas vi /proc/cmdline.
GRUB-based Alpine
Edit: doas vi /etc/default/grub and ensure you have GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200"
Then just create a config and boot
doas grub-mkconfig -o /boot/grub/grub.cfgdoas reboot
Proxmox
In Proxmox, the VM must have a serial device. Add one by
Hardware→Add→Serial Port- Use
socket - You might like to set
Display→Serial terminal(Option)
Otherwise, Alpine can be perfectly configured and still show nothing.
FreeBSD
FreeBSD, is closer to the Alpine philosophically:
- no systemd,
- no services for
gettyon-demand – it’s done viattysand loader/kernel hints.
Here is the canonical, correct FreeBSD way.
If it’s a TTY, it lives in
/etc/ttys.Enable serial login /etc/ttys – the key part
Edit: sudo vi /etc/ttys, you’ll see lines like:
ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure
Add or modify the serial line:
ttyu0 "/usr/libexec/getty std.115200" vt100 onifexists secure
ttyu0 = first serial port (COM1 / ttyS0 equivalent)std.115200 = speed profile (defined in /etc/gettytab)secure = allows root login on serial (optional but common)onifexists = only start if device existsThis alone is the equivalent of enable + start. No reboot required for login availability.
Enable serial console output (boot messages)
For temporarily running sudo vidcontrol -f /dev/ttyu0. Useful for testing.
Permanently — loader configuration
Edit: sudo vi /boot/loader.conf and add console="comconsole,vidconsole" comconsole_speed="115200". This ensures that bootloader & kernel output go to serial.
Headless systems – serial only
If you want no VGA at all: /boot/loader.conf console="comconsole".
Optional but common on servers.
On a VM – Proxmox / QEMU
Make sure:
- A serial device is actually attached
- Speed matches
115200 - VM console is connected to COM1
Otherwise, FreeBSD will be perfectly configured and still appear dead.
Verify after boot
dmesg | grep ttyu
ps -ax | grep getty
cat /proc/cmdline # (does not exist on FreeBSD — absence is expected)Doesn't exist on FreeBSD – absence is expected
One-line takeaway
Mapping table
| Concept | Debian | Alpine | FreeBSD |
|---|---|---|---|
| Enable serial login | systemd unit | etc/inittab |
etc/ttys |
| Boot console | GRUB | syslinux / EFI stub | /boot/loader.conf |
| Start mechanism | PID 1 | BusyBox init | init + ttys |
| Service manager | systemd | OpenRC | rc.d (not used here) |