I am trying to set up a CentOS 7 as my development box in Virtual Box 5.0.2. I share the project folder from the host, that is running windows 7, with the guest (then I can use the windows GUI and use an IDE to do the interaction on windows, while my code is running on CentOS).
I am doing some development in node. While setting up my project and doing npm install
, I got an error as:
49132 error Linux 3.10.0-327.13.1.el7.x86_64
49133 error argv "/home/wdd/nvm/versions/node/v5.10.0/bin/node" "/home/wdd/nvm/versions/node/v5.10.0/bin/npm" "install"
49134 error node v5.10.0
49135 error npm v3.8.3
49136 error path /home/wdd/share/mynps-corporate-client/node_modules/.staging/iconv-lite-94545a9f
49137 error code EPERM
49138 error errno -1
49139 error syscall rename
49140 error Error: EPERM: operation not permitted, rename '/home/wdd/share/mynps-corporate-client/node_modules/.staging/iconv-lite-94545a9f' -> '/home/wdd/share/mynps-corporate-client/node_modules/iconv-lite'
49140 error at destStatted (/home/wdd/nvm/versions/node/v5.10.0/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
49140 error at FSReqWrap.oncomplete (fs.js:82:15)
49140 error
49140 error Error: EPERM: operation not permitted, rename '/home/wdd/share/mynps-corporate-client/node_modules/.staging/iconv-lite-94545a9f' -> '/home/wdd/share/mynps-corporate-client/node_modules/iconv-lite'
49140 error at Error (native)
49140 error { [Error: EPERM: operation not permitted, rename '/home/wdd/share/mynps-corporate-client/node_modules/.staging/iconv-lite-94545a9f' -> '/home/wdd/share/mynps-corporate-client/node_modules/iconv-lite'] parent: 'mynps-corporate' }
49141 error Please try running this command again as root/Administrator.
49142 verbose exit [ -1, true ]
When I searched online, I get to know the problem is with the symlinks. Symlinks are disabled by default on shared folders, so the following also fails:
ln: failed to create hard link ‘ln-server.js’ => ‘server.js’: Operation not permitted
I have tried:
sudo
on guest- 'Run as Administrator' virtual box on host.
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1
- Updated User Security Policy and allowed create symbolic links to 'Everyone'
- Allowed all the privileges to everyone on security settings of the project folder properties in host machine.
I have already used the following links:
- Correct way to setup Virtualbox 4.3 to use symlinks on guest (for meteor)
- Symlinks in shared folder of virtual box with Windows 10 host
- https://www.virtualbox.org/ticket/10085
- https://askubuntu.com/questions/446317/how-to-make-guest-os-follow-symlinks-from-shared-folder
- https://superuser.com/questions/659270/accessing-symbolic-links-in-virtualbox
Update (2016-04-21): For now I have made a work around. I do an npm install
in a directory that is not shared, and then moved the node_modules directory to the shared directory, and there is no problem. As it we do not install modules so frequently, it is fine. But yet, it would be great if one can point out a real solution for this.