this post was submitted on 02 Nov 2023
28 points (96.7% liked)

Linux

48691 readers
334 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Is it possible to copy paste with QEMU?

I'm running Arch on my machine with Kali in a QEMU VM and I'd like to copy paste between the two. How can this be done?

top 18 comments
sorted by: hot top controversial new old
[–] [email protected] 13 points 1 year ago (1 children)
[–] [email protected] 2 points 1 year ago (2 children)

I've tried this solution but could not get it to work. Do I need to install Spice on Arch? Do I have to run QEMU with certain parameters?

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Are you running QEMU directly, or through libvirt (GNOME Boxes, Virt Manager)?

EDIT: NVM I see you’ve answered that in another comment. I believe you can’t do this with QEMU directly. If you don’t need to be able to edit the VM config besides core count, disk size and RAM use GNOME Boxes. Otherwise use Virt Manager.

[–] [email protected] 6 points 1 year ago* (last edited 1 year ago) (2 children)

I know this isn't a real answer, but it's what I use as a stop gap measure... I basically have a text file called buffer, and ssh into the VM on a terminal on my host, and paste into the buffer file.

I know it's lame, but for simple text and stuff, it works. For things like files and pics, I use a shared drive.

If someone has a better answer... Please let me know!

[–] [email protected] 5 points 1 year ago

Grug brained solution. It no fancy but work. Grug happy. Now have time to relax.

[–] [email protected] 1 points 1 year ago (1 children)

That's such an incredibly janky solution holy shit lol

SPICE is the answer

[–] [email protected] 1 points 1 year ago

The spice must flow....

I see that spice is a grayed-out option in Proxmox, is it relatively easy to get it going?

[–] [email protected] 5 points 1 year ago (1 children)

I assume you're using a GUI or else you could just ssh. I also assume you're currently using a VNC viewer of some sort?

RDP does support copy/paste. I haven't tried it with a qemu VM, only a VMware VM (what my work uses), and it mostly works. I have xrdp running on the target device, then I just use Windows' built-in RDP client to log in.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

No VNC viewer. QEMU works like VirtualBox. It's just a VM running on your computer. When QEMU is ran it opens a graphical display of the VM's Desktop.

I'd be interested in moving the Kali VM to my home server and RDP into it. I'm familiar with RDP on Windows but I'm not sure how to RDP from Linux (Arch) to Linux (Kali). I suppose something like Remmina would do the job, though I found a lot of input lag with it.

[–] damium 3 points 1 year ago

QEMU supports either spice, vnc or sdl graphics output. If you want to copy/paste you need to use spice and install the spice agent on the VM.

[–] [email protected] 3 points 1 year ago (1 children)

Just in case you are on a desktop and using qemu for local virtualisation, I would recommend you use virt-manager.

Besides that, set up spice or vnc daemons in the guests, as others have said.

Just in case You're virtualising Kali Linux, use their provided qemu image, you won't have to worry about it. If you don't know what Kali is, don't use it.

[–] [email protected] 2 points 1 year ago (1 children)

Thank you for the virt-manager recommendation. I'll look into it.

I did build Kali from their ISO but I'll give their provided image a try. I do know what Kali is and what it is used for. I'll be using it for TryHackMe labs.

[–] [email protected] 3 points 1 year ago (1 children)

Okay, so my guess was right. Don't bother setting things up manually, qemu and libvirt are hellishly complex. If you don't need something super special, use virt-manager.

Just use the provided qemu image on the Kali site, import it, and you're good to go. Don't worry about the other stuff.

Depending in your screen you might have to set a custom screen resolution, but if you're using something standard, xfce should automatically recognize everything.

A little tip: set up an ssh server on the VM and upload an ssh key, that way you can get a Kali she'll quickly from the comfort of your hosts terminal.

[–] [email protected] 2 points 1 year ago (1 children)

After some work, I got virt-manager up and running with kali. Copy and paste works! Thank you so much for your help!

[–] [email protected] 1 points 1 year ago

Sure, happy hacking

[–] [email protected] 2 points 1 year ago (1 children)

Spice-vdagent on the VM client.

[–] [email protected] 2 points 1 year ago

I presume that only works if you use spice, tho