Clipboard and folder sharing are usually an important feature to have when we run virtual machines. So here am I sharing the complete guide for you guys.
I found people talking about Qemu/KVM on Reddit, so I decided to try. Main reason why I wanted to try because I want to move away from VirtualBox that I can never enable folder sharing, and VMWare which is paid.
I am currently running Ubuntu 20.04 as the Host and Windows 10 as the Guests.
It is quite confusing when you first started. I started with virt-manager and had no clipboard sharing enabled. By default, virt-manager is using SPICE. The key to this tutorial is, install
Spice WebDAV daemon.
I am writing this tutorial based on virt-manager. It should be working for any SPICE remote viewer too such as Cockpit (tested).
Solution – Clipboard sharing
(Updated as 26th Oct)
Step 1 – Download spice-guest-tools to Windows Guest
Open the download page (https://cutt.ly/2ROq8dK) on your Windows Guest, scroll down a bit until you found Windows binaries under Guest, click the Windows guest tools link to start the download. Or you can use this link
https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe Or easier, shortened URL: https://cutt.ly/SROqBqZ
Step 2 – Run and install spice-guest-tools
After the file is available on your Windows Guest, run and install the program.
The display might blinking a few times, so don’t worry about that.
Step 3 – Test your copy/paste
You are pretty much finished. Try copying something in your Windows Guest and paste it in your Host, it should work. But if it doesn’t, try rebooting the VM. If it still won’t work, remove the program and reinstall. It should be working.
Solution – Folder sharing
(Updated as 26th Oct)
So, you have clipboard sharing enabled and now want to share folder?
We will be using
Unfortunately, virt-manager has not implemented SPICE WebDAV in its client. So, we are going to use Cockpit, the alternative.
Step 1 – Install Cockpit and Cockpit Virtual Machines
First, install Cockpit and Cockpit Virtual Machines. For Ubuntu, run
Ubuntu: $ sudo apt install cockpit cockpit-machines Arch: $ sudo pacman -Sy cockpit cockpit-machines
If you are using another Linux distribution, refer this page. You will still need to install
cockpit-machines using your package manager to enable Virtual Machine manager.
Then enable and start cockpit
$ sudo systemctl enable cockpit.socket $ sudo systemctl start cockpit.socket
Step 2 – Open the Web-UI in your browser
Cockpit provides Web-UI which you can access to use the program. Simply open this URL in your browser
Login using your PC user and username
Step 2 – Go to Virtual Machine and shutdown your VM
You need to shutdown your VM or your settings in the next few steps probably won’t work. Simply go to Virtual Machines and hit the Shut Down button to turn off the VM.
Notes: If your Virtual Machine is empty, go to Overview and check if there is a notification at the top asking for a permission. Allow the access and your VMs should be showing up.
Step 3 – Open virt-manager, add new hardware
virt-manager, right click on your VM and select open. You can also click on your VM, then hit the big “Open” button at the top.
Click Add Hardware and select Channel. Delete whatever in “Name” column, and insert this
Step 4 – Return to Cockpit Web-UI, run your VM
You don’t need virt-manager for now, so you can close it. Then return to Cockpit Web-UI and hit Run button to start your VM.
Then go to Consoles tab and click “Launch remote viewer”
Click “OK” and you will see your Windows Desktop.
Step 5 – Enable Folder Sharing
Click menu File, then select Preferences. tick “Share Folder” and choose which folder you want to share with the Guest.
Notes: On Arch, Preferences is in hamburger menu on the right.
Download and install spice-webdavd in Windows Guest. Pay attention on the file extension. You will want to donwload .msi file which usually larger than the other. Or you can just use this link for the latest installer
https://www.spice-space.org/download/windows/spice-webdavd/spice-webdavd-x86-latest.msi Be aware, some browsers will open the link instead of downloading it. At least Edge displaying the file content to me instead of downloading it.
Then in the Windows, open Task Manager and go to Services tab. Find “spice-webdavd” and start the process if it doesn’t.
Step 7 – Verify the Folder Sharing is working
After running the “Spice webdav proxy” service, you should see a new storage in “This PC” or “My Computer”.
Try creating a file or folder and check shared folder on your Host to see if the changes reflected.
You are now done 🙂