canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.88k stars 651 forks source link

Cannot copy .lnk file to Windows mount #1624

Open fquinner opened 4 years ago

fquinner commented 4 years ago

Describe the bug Since multipass seems to treat .lnk files like symlinks, it seems to be impossible to copy actual shortcut files for legitimate reasons (complete with starting directories, comments etc).

To Reproduce

ubuntu@primary:~/mslink_v1.3$ cp about.lnk ~/Home/Desktop/
cp: not writing through dangling symlink '/home/ubuntu/Home/Desktop/about.lnk'

Expected behavior I expected the .lnk to be treated like a regular file. A .lnk isn't really the same as a symlink in Linux.

Logs N/A

Additional info

Name: advisable-gar State: Running IPv4: 172.20.155.131 Release: Ubuntu 20.04 LTS Image hash: d75d900f406d (Ubuntu 20.04 LTS) Load: 0.08 0.02 0.01 Disk usage: 1.3G out of 4.7G Memory usage: 532.9M out of 916.9M



**Additional context**
I run the project https://github.com/cascadium/wsl-windows-toolbar-launcher and I was hoping i could set up GUI menus for multipass too which depend on generating `.lnk` files from the Linux environment hence looking at this. Thanks in advance!
townsend2010 commented 4 years ago

@fquinner,

Hey, thanks for the bug report. We'll take a look.

townsend2010 commented 4 years ago

Hi @fquinner,

I can easily reproduce the behavior you describe and will work on a fix.

In the meantime, there might be a workaround depending on your workflow. The multipass copy-files command will copy the .lnk file correctly to the host Windows system. For example, on the host, you would enter something like:

$ multipass copy-files primary:path/to/lnk C:\Users\user\Desktop

Let us know if that is sufficient for you in the short term. Thanks!

fquinner commented 4 years ago

Yeah I already have a workaround with samba mounting the drive instead which unblocked me until this was fixed but thanks for the other option!

I hit other issues though down the line in #1631 (the idea in this instance is to try and have like a "companion" VM that can act in a way similar to WSL2 but with its own fully virtualized kernel, so I don't want anonymous usernames). I'm sure that's drifting beyond the core goals of Multipass (hence marking that one as an enhancement), but it's how I was trying to use it nevertheless 😄 .