dch53
Contributor
Contributor

How to mount a Windows share in a Linux guest permanently?

Jump to solution

Hi. I set up an openSUSE_Leap15.2 VM setup on a Windows 10 host with the intention of learning about Linux.

Mounting Shared Folders in a Linux Guest describes how to mount a host share in a Linux guest. I have Shared Folder enabled and a host folder shared with name "foo". In my guest I have created the folder "Share" in my Home directory.

I'm sure I got mount -t vmhgfs .host:/foo /Home/Share/foo

to work yesterday. Today, the folder "Share" is there but is empty. Attempts to rerun this command result in

Error: cannot canonicalize mount point: No such file or directory

which sadly means nothing to me.

What is the correct syntax please and how to I get the mounted share to still be mounted after restarting the VM?

Thanks.

0 Kudos
1 Solution
9 Replies
ajgringo619
Hot Shot
Hot Shot

I think the mountpoint should have a lower-case /home; everything else looks correct.

Does /home/share/foo exist?

0 Kudos
dch53
Contributor
Contributor

Thanks for the reply. I've just checked and I'm working with a kernel later than 4.0. So, the command I should be using is

/usr/bin/vmhgfs-fuse .host:/foo /tmp/foo -o subtype=vmhgfs-fuse,allow_other

which I have as:

/usr/bin/vmhgfs-fuse .host:/foo /Home/foo -o subtype=vmhgfs-fuse,allow_other

Now I get

fuse: bad mount point `/Home/foo': No such file or directory

It doesn't make a difference whether I capitalise the H on Home or not. The directory "foo" exists.

I should have made careful note of what I did yesterday that worked!

 

 

0 Kudos
ajgringo619
Hot Shot
Hot Shot

OK, here's what I did to get a VMware-shared directory mounted on EnvdeavourOS:

$ sudo vmhgfs-fuse .host:/shared /mnt -o allow_other -o uid=1000

0 Kudos
dch53
Contributor
Contributor

Thanks. I ran that and there were no errors. Where does that command mount the share too?

0 Kudos
ajgringo619
Hot Shot
Hot Shot

/mnt. I used it because I knew it would exist. I had switched to NFS awhile back, so I'd removed the /etc/fstab entry I had created for this.

Hmmm... did you copy my command verbatim? You need to change shared to whatever your VMware shared folder is called, and replace /mnt with where you want it mounted.

0 Kudos
dch53
Contributor
Contributor

OK. I was able to get this to work as su:

/usr/bin/vmhgfs-fuse .host:/foo /home/opensuse/Share -o subtype=vmhgfs-fuse,allow_other

Folder foo was created in folder Share.

0 Kudos
dch53
Contributor
Contributor

However, when I reboot, I have to run the command again. Is there any way of getting the mount to persist between reboots?

0 Kudos
dch53
Contributor
Contributor

Thanks very much. I had to search on how to modify /etc/fstab with elevated privileges so I could save it but once I found that it worked perfectly.

0 Kudos