-
Notifications
You must be signed in to change notification settings - Fork 1
/
mount-vmware-shared-folder-linux.txt
65 lines (52 loc) · 1.59 KB
/
mount-vmware-shared-folder-linux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# first install openvm tools
sudo apt-get install open-vm-tools
sudo reboot
#########################################################
# using mount
#########################################################
mount -t vmhgfs .host:/win7share /mnt/hgfs
#########################################################
# using fstab
#########################################################
.host:/win7share /mnt/hgfs vmhgfs defaults 0 0
#########################################################
# using systemd and fuse
#########################################################
sudo mkdir -p /iso-share
sudo nano -w /opt/mount-vmware.sh
................
#!/bin/bash
/usr/bin/vmhgfs-fuse -o auto_unmount .host:/arcana/Downloads/ISO_Library /iso-share
................
sudo chmod +x /opt/mount-vmware.sh
sudo nano -w /opt/umount-vmware.sh
................
#!/bin/bash
umount /iso-share
................
sudo chmod +x /opt/umount-vmware.sh
# create systemd service
sudo nano -w /lib/systemd/system/mount-vmware.service
...
[Unit]
Description=mount vmware shared folder
Conflicts=shutdown.target
Wants=network-online.target
Before=smbd.service iscsitarget.service
# Enable below on Fedora/CentOS only!
# After=network-online.target NetworkManager-wait-online.service
# Enable below on non-Fedora/CentOS only!
# After=network-online.target
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/opt/mount-vmware.sh
ExecStop=/opt/umount-vmware.sh
Restart=always
[Install]
WantedBy=multi-user.target
...
# enable service
sudo systemctl daemon-reload
sudo systemctl enable mount-vmware.service
sudo systemctl restart mount-vmware.service