this post was submitted on 21 Apr 2024
33 points (100.0% liked)

Linux

47237 readers
3343 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
 

I'm having the hardest tine setting up a shared folder between a Linux host and Win11guest. I want to get rid of dual boot, but there are a few programs that I use which are Win only. I have set up a VB VM, but I want a fine tuned KVM VM. On VB sharing is trivial, but I can't get it to work in KVM. I have the host sharing the folder with Samba, and can see it from another Linux VM, but not from windows. Any clues?

top 10 comments
sorted by: hot top controversial new old
[–] [email protected] 11 points 5 months ago* (last edited 5 months ago) (1 children)

First of all, forget all the Spice-based viewers - by far the best solution for interacting with a Windows guest is using freeRDP. It's extremely smooth and lightweight, and feels like you're interacting with Windows natively - unlike Spice viewers which feel very clunky. With freeRDP, you don't need to configure Samba etc, clipboard sharing works, dynamic resolution works, and you can even use seamless windows (RemoteApps) to make it look like you're natively running a Windows app in Linux!

Just enable Remote Desktop in Windows, and then from your host machine, you can run the following command to connect to your VM:

xfreerdp /v:192.168.122.xxx /u:dexter /p:password /drive:/home/dexter/Downloads,Downloads /cert:ignore /dynamic-resolution +clipboard /scale:180 /f

  • Obviously, change the above parameters according to your system.
  • Setting a static IP inside Windows would also make it easier, so you can just create a shortcut/script with the above command.
  • In my above command, I've shared my Downloads folder. This will appear in Windows as the share \\tsclient\Downloads. You can then map this share to a drive inside Windows to make it easier to access.
  • I'm on a HiDPI monitor so I've enabled scaling with the /scale:180 parameter.

Alternatively, you could use a GUI tool like Remmina, which uses freeRDP in the backend.

I also highly recommend using freeRDP v3.x if possible - this is available in Arch (AUR) and Flatpak. The reason being, freeRDP has made numerous improvements since v3.0 (released December last year), which make it 100% worth the upgrade - but most distros seem to be stuck on 2.xx for some reason.

Let me know if you have any questions. I use Win11 guests on KVM almost daily for testing various things as part of my job, and I access it via freeRDP without any issues.

[–] [email protected] 1 points 4 months ago

I had thought spice was supposed to be really good for VMs, it's it just over hyped?

[–] [email protected] 2 points 5 months ago

Sounds like a network issue, not a KVM issue. Have you done any troubleshooting from that angle, and if so, what have you found?

[–] [email protected] 2 points 5 months ago

The native directory sharing method for kvm is virtiofs. Have you tried it?

[–] [email protected] 2 points 4 months ago

Back when I had to use a windows vm just did

qemu ... -net user,smb=$HOME/

then in the windows vm just type \\10.0.2.4 into file explorer. Does that not work?

man qemu says:

              smb=dir[,smbserver=addr]
                     When using  the  user  mode  network  stack,  activate  a
                     built-in  SMB  server  so that Windows OSes can access to
                     the host files in dir transparently. The  IP  address  of
                     the  SMB server can be set to addr. By default the 4th IP
                     in the guest network is used, i.e. x.x.x.4.

                     In the guest Windows OS, the line:

                        10.0.2.4 smbserver

                     must be added in the file C:\WINDOWS\LMHOSTS (for windows
                     9x/Me)  or C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS (Windows
                     NT/2000).

                     Then dir can be accessed in \\smbserver\qemu.

                     Note that a SAMBA server must be installed  on  the  host
                     OS.

Another way is to setup Spice and use a webdav daemon in Windows to transfer files over Spice folder sharing.

You could also just RDP to the machine which is probably the easiest.

The simplest would just be to scp files to and from Windows. Like in powershell do scp -R [email protected]:~/path/stuff output_dir to get files from Linux.

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

I used this Guide (KVM +qemu) in a previous installation. I'm an intermediate Linux user and got it working without much trouble. Maybe it will fit your use case

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

there are a few programs that I use which are Win only

Have you tried Bottles/WINE/Proton/whatever?

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

Some people have, with not great results. The software is the Affinity suite (design, photo, publishing, and I have used Inkscape, Gimp, and Scribus, but they aren't there yet for me) A windows VM is fine for now, but VB is a bit sluggish. My aim is to set-up a physical partition for the VM, and try GPU passthough.

[–] [email protected] 1 points 4 months ago

There is or was a project called WinApps i think that made it easy to set up a VM to run some applications.