1

How can I copy paste in text mode from host to guest virtual machine? I have read answers that recommend using spice, but that works for X sessions, not in text mode, or not from host's X session to guest text mode.

I don't need graphics mode in the guest since it is to test a server.

I am using qemu-system and libvirt.

Thanks in advance for any help.

user2309000
  • 29
  • 1
  • 4
  • You can't. However, when you define a serial console in the VM, you can access it in a normal terminal with virsh console and use copy-paste. In addition to specifying a serial console in the XML file (or via virt-manager, if that is possible), you will also have to set a kernel parameter like console=ttyS0. – berndbausch Mar 23 '21 at 06:35
  • Thank you berndbaush. Actually the solution is very easy. – user2309000 Mar 25 '21 at 04:57

1 Answers1

1

Actually, the solution is simple, just connect to the VMs using your normal terminal by ssh in which you can use cut & paste.

user2309000
  • 29
  • 1
  • 4
  • Great method, but I had to look up what host to put in the ssh command. One way is to run ip addr in the VM and use the numbers in the inet line. So, ssh root@192.168.123.45 for example – Heitor Chang Jan 05 '24 at 16:07