# Hgfs shared filesystem in VMWare does not support symlinks

**URL:** https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797
**Category:** Development
**Created:** [12월 27, 2017, 4:48오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797 "2017-12-27T04:48:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [12월 27, 2017, 4:48오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/1 "2017-12-27T04:48:29Z")

</div>

`bundle exec rake db:migrate db:test:prepare db:seed_fu` fails:

```plaintext
ln: failed to create symbolic link 'public/plugins/discourse-narrative-bot': Permission denied
lib/discourse.rb:28:in `execute_command'
lib/plugin/instance.rb:459:in `activate!'
lib/discourse.rb:147:in `block in activate_plugins!'
lib/discourse.rb:144:in `each'
lib/discourse.rb:144:in `activate_plugins!'
config/application.rb:186:in `<class:Application>'
config/application.rb:26:in `<module:Discourse>'
config/application.rb:25:in `<top (required)>'
rakefile:5:in `require'
rakefile:5:in `<top (required)>'
~/.rbenv/versions/2.4.2/bin/bundle:23:in `load'
~/.rbenv/versions/2.4.2/bin/bundle:23:in `<main>'

```

 ![01](https://global.discourse-cdn.com/meta/original/3X/5/4/54d4ff23e5c6c547ef7914e7a8f88887f62b0ded.png)

It looks like this issue has not been solved for many years: [communities.vmware.com/thread/312591](https://communities.vmware.com/thread/312591)

> I ended up moving the directory out of my VM’s shared folder to a new location.  
> It seems to be installing fine now.  
> **I don’t guess the symlink works when its in a shared folder**.

[stackoverflow.com/questions/40920896#comment69054665\_40920896](https://stackoverflow.com/questions/40920896#comment69054665_40920896)

> **Symbolic links seem to be a recurrent problem for VMWare shared directories** between different operating systems.

[github.com/Cisco-Talos/pyrebox/issues/12#issuecomment-320589824](https://github.com/Cisco-Talos/pyrebox/issues/12#issuecomment-320589824)

> Currently **for Windows hosts symlinks are not supported**.  
> We currently don’t have plans to add it either.

[sourceforge.net/p/open-vm-tools/mailman/message/29280098](https://sourceforge.net/p/open-vm-tools/mailman/message/29280098)

> The underlying file system in Windows is NTFS which does not support symbolic links in the same way as Linux does.  
> **The creation of symlinks in directories that are NTFS mounts (like the vagrant shared folders) will always fail**.

[github.com/hashicorp/vagrant/issues/5840#issuecomment-115051381](https://github.com/hashicorp/vagrant/issues/5840#issuecomment-115051381)

So, how to use **VMware Workstation** as a development environment for Discourse with Windows host operating system?  
Maybe there is a workaround?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [12월 27, 2017, 5:02오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/2 "2017-12-27T05:02:41Z")

</div>

What instructions are you following? I don’t recall having ever seen any that involved going into `/mnt /hgfs/code`

---

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [12월 27, 2017, 5:27오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/3 "2017-12-27T05:27:10Z")

</div>

I need to make the Discourse’s folder shared between my Windows host and my VMware Workstation Ubuntu guest to use an [integrated development environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) of my host operating system.

---

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [12월 27, 2017, 5:45오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/4 "2017-12-27T05:45:35Z")

</div>

My workaround is to patch the [`Plugin::Instance.activate!`](https://github.com/discourse/discourse/blob/v1.9.0.beta17/lib/plugin/instance.rb#L408-L461) method.

Locate the code:

> <https://github.com/discourse/discourse/blob/v1.9.0.beta17/lib/plugin/instance.rb#L458-L459>

Replace it with the code:

```plaintext
Discourse::Utils.execute_command('rm', '-rf', target)
begin
  Discourse::Utils.execute_command('ln', '-s', public_data, target)
rescue
  Discourse::Utils.execute_command('cp', '-r', public_data, target)
end

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12월 27, 2017, 5:45오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/5 "2017-12-27T05:45:36Z")

</div>

I use VMWare, strongly recommend against putting the code in the fused filesystem it will be much slower. I keep it on my ext3 volume inside the vm.

If really really want windows to have access to this stuff for IDE

Option 1:

Set up samba locally and just edit off samba

Option 2:

Use something like [http://docker-sync.io/](http://docker-sync.io/)

---

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [12월 27, 2017, 6:00오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/6 "2017-12-27T06:00:49Z")

</div>

What do you think about including [my solution above](https://meta.discourse.org/t/topic/76797/4) to the code?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12월 27, 2017, 6:12오전 UTC](https://meta.discourse.org/t/hgfs-shared-filesystem-in-vmware-does-not-support-symlinks/76797/7 "2017-12-27T06:12:31Z")

</div>

It breaks the way plugins install, not ideal.
