[HOME] [DOWNLOAD] [DOCS] [NEWS] [SUPPORT] [TIPS] [ISSUES] [CONTRIBUTE] [DONATE]

linux questions - How do i make "Share folder" option run automatically by using terminal in spice

Hi There

How do i make “Share folder” option enable automatically by using terminal in spice, Current command im using is:

virsh start win10 && virt-viewer --connect=qemu:///system --domain-name win10 --spice-shared-dir=/home/$USER/Downloads

host Debian 11 & guest Windows 10

photo_2021-07-19_12-01-21

Please check out this article for more info. https://askubuntu.com/a/1127273

There was no interest from me to figure out Windows file sharing but there could be helpful clues in this link above.

I saw it , but I don,t find how can I enable share folder like in picture with command line

Try doing it with SAMBA shares instead:

https://web.archive.org/web/20160102195151/http://www.linux-kvm.com/content/tip-how-you-can-share-files-your-linux-host-windows-guest-using-samba

I’m having the same problem.

When I start virt-viewer from a command line with: “virt-viewer --spice-shared-dir=…”,
The viewer starts with the shared folder NOT-ACTIVE.
I would like the viewer to start with the shared folder being ACTIVE.

What occurs at virt-viewer startup:

File->Preferences
[NOT-CHECKED] Share folder FolderName

What I want to occur at virt-viewer startup:

File->Preferences
[CHECKED] Share folder FolderName

How do I start virt-viewer from the command line so that the shared folder is ACTIVE?

P.S.
I have file sharing working. It just annoying that every time I launch virt-viewer, I have to MANUALLY activate file sharing (can NOT do it in a bash script).

Try removing the setting that explicitly forbids spice drag and drop folders then save and retry again

I’m sorry. I don’t know where this setting is located.
What I’ve tried:

  1. chmod -R 0777 ~/SharedFolder #Remove all write restrictions
  2. Examined the virtual machine “Overview” XML shown in “virt-manager”, and found nothing forbidding drag and drop.
  3. Examined all of the GUI options in “virt-manager” and “virt-viewer”, and found nothing forbidding drag and drop.
  4. Removed “Channel spice-webdav” from “virt-manager” (broke file sharing). Grayed out the virt-viewer file share option.
  5. Web searched for: “forbid” “drag and drop” “spice”. Failed to learn how to do as you instructed.

I’d appreciate a pointer on how to remove the setting as you instructed.

edit the settings then remove:

  <filetransfer enable='no'/>

Thank you for the info.

Unfortunately, the string “filetransfer” does not exit in the XML list.
I examined the XML list three ways:

  1. sudo vim /etc/libvirt/qemu/DomainName.xml
  2. sudo virsh edit DomainName
  3. virt-manager->Overview-tab/OS information-tab/Performance-tab

Am I doing something wrong?

I’m pretty sure it does.

I think you need better assistance. Please post on the libvirt-users mailing list and they will help you:

https://listman.redhat.com/mailman/listinfo/libvirt-users

[Imprint] [Privacy Policy] [Cookie Policy] [Terms of Use] [E-Sign Consent] [DMCA] [Contributors] [Investors] [Priority Support] [Professional Support]