Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on Windows host/Linux guest symbolic link is generated with backslashes #6024

Closed
tokiloki opened this issue Jul 22, 2015 · 27 comments
Closed

Comments

@tokiloki
Copy link

I use simple Vagrantfile

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
end

Running

vagrant up
vagrant ssh
cd /vagrant
ln -s /vag/log
ls -l

I see

lrwxrwxrwx 1 vagrant vagrant   0 Jul 22 22:56 log -> \var\log\

Backslashes is a problem here as I understand. This symbolic link is not usable.

VirtualBox 5.0.0
Vagrant 1.7.4

@sethvargo sethvargo added this to the 1.8 milestone Jul 23, 2015
@sseidelmann
Copy link

Please fix this asap.

Have you a workaround for this? We need this to develop our software

Thanks a lot

VirtualBox 4.8.x
Vagrant 1.7.2

@toser
Copy link

toser commented Jul 30, 2015

Same here. This is a very critical issue!

@Flowman
Copy link

Flowman commented Jul 31, 2015

If you downgrade to VirtualBox 4.3.30 symlinks works again. I noticed the weird backslashes in version 5.0.0

Windows 10
VitrtualBox 4.3.30
Vagrant 1.7.4

@toser
Copy link

toser commented Jul 31, 2015

Thanks for pointing this out. Can someone confirm this? For me only version 5 of VirtualBox works on on Windows 10, but with weird backslashes..

@sseidelmann
Copy link

We will test this

@Flowman
Copy link

Flowman commented Jul 31, 2015

Host-only nic and symlinks are broken in Virtualbox 5.0.0.

VirtualBox 4.3.30 installs fine on Windows 10, have not had any issues yet.

@charly37
Copy link

charly37 commented Aug 5, 2015

Hi guys,

Same error here.

How to reproduce:

Install software
-windows 7 Entreprise SP1 64bits
-VirtualBox : 5.0.0 r101573
-Vagrant 1.7.4

Start software
-using windows cmd :

c:\DEV_CODE>mkdir test
c:\DEV_CODE>cd test
c:\DEV_CODE\test>vagrant init hashicorp/precise64
c:\DEV_CODE\test>vagrant up

-logged in the VM :

vagrant@precise64:~$ ln -s /tmp/ toto
vagrant@precise64:~$ ll toto
lrwxrwxrwx 1 vagrant vagrant 5 Aug  5 18:40 toto -> /tmp//

vagrant@precise64:/vagrant$ ln -s /tmp/ toto
vagrant@precise64:/vagrant$ ll toto
lrwxrwxrwx 1 vagrant vagrant 0 Aug  5 18:40 toto -> \tmp\

Issue
The symlink creation no longer works inside shared folder (vagrant is shared by default)

I also find the Filesystem type to be strange in df output

vagrant@precise64:/vagrant$ df
Filesystem                 1K-blocks     Used Available Use% Mounted on
/dev/mapper/precise64-root  82711212  2256852  76312076   3% /
udev                          178072        4    178068   1% /dev
tmpfs                          74852      280     74572   1% /run
none                            5120        0      5120   0% /run/lock
none                          187128        0    187128   0% /run/shm
/dev/sda1                     233191    24966    195784  12% /boot
vagrant                    104857596 78982132  25875464  76% /vagrant

Maybe it is link...

I will try to downgrade to VB < 5 and update the ticket when I have some time.

Thx.

@charly37
Copy link

charly37 commented Aug 5, 2015

I confirmed it is OK after downgrade to VB 4.3.30

@sseidelmann
Copy link

We have a developer with older version 4.3.26. It will work fine too.

@simonknittel
Copy link

Don't know if it's related to this problem, but I think it fits.

I'm using Vagrant 1.7.4 with ubuntu/trusty64 as guest on a Windows 10 host with Virtualbox 5.0.2r102096.

It got the /var/www directory on Ubuntu synced with my host.

I'm doing the following:

cd /var/www/application/htdocs
ln -s ../typo3_src-7.4.0 typo3_src

(the typo3_src-7.4.0 directory, which is my target, is in /var/www/application).

Now I check the content of the directory:

ls -l
lrwxrwxrwx 1 vagrant vagrant 0 Aug 16 13:54 typo3_src -> ..\typo3_src-7.4.0

(which is colored in red).

When I check the symlink directly:

readlink -f typo3_src
/var/www/application/htdocs/..\typo3_src-7.4.0

@486
Copy link

486 commented Aug 25, 2015

I am also on Win 10 and downgraded to VB 4.3.30 now.

Creating symlinks does not work for me at all ("protocol error") unless I run the command line "as Administrator" and then vagrant up, basically as described here http://www.ahtik.com/blog/fixing-your-virtualbox-shared-folder-symlink-error/

Is that normal behavior or is there a way to do this without admin rights? Should I create a separate issue?

@wassimsalib
Copy link

Virtualbox just released a fix for this issue and it is working now, you need to download and install this test build https://www.virtualbox.org/download/testcase/VirtualBox-5.0.3-102224-Win.exe
Here is the link to the issue: https://www.virtualbox.org/ticket/14335

@simonknittel
Copy link

Running now VB build 102322.

Works yes and no (or I'm making a mistake).

Creating a symlink with relative path

ln -s ../typo3_src-7.4.0 typo3_src

does not work. It produces a protocol error.

Creating a symlink with absolute path

ln -s /var/www/application/typo3_src-7.4.0 typo3_src

does work.

@vomlehn
Copy link

vomlehn commented Sep 12, 2015

I see the same thing. It was an upgrade from 5.0.2 (pretty sure but not positive) to 5.0.4 where things broke. This is a pretty big issue for me; I have a huge chunk of software that doesn't build because of this. It's way too much software to try and go in and tweak this.

@sej7278
Copy link

sej7278 commented Sep 15, 2015

seeing @simonknittel's problem too - with 5.0.4 on linux host and guest relative paths are broken, absolute paths work fine, nothing to do with backslashes as far as i can see though, gives protocol error not permission denied.

its not a vagrant problem though is it, its a virtualbox one.

@emirotin
Copy link

emirotin commented Oct 5, 2015

It seems to be fixed with VBox 5.0.6

@vomlehn
Copy link

vomlehn commented Oct 5, 2015

I've had problems building Tango on
  VBox 5.0. The issue is also related to symbolic links, on a Linux
  host. Sometimes they work, sometimes they don't. I think they work
  only if the link is in the same directory, but haven't done
  extensive testing. I had to back off to version 4.3.30, which
  seems to work. This is a problem that Oracle seems to know about
  but which is proving a challenge to fix fully.

  On 10/05/2015 04:28 AM, Eugene Mirotin wrote:


  It seems to be fixed with VBox 5.0.6
  —
    Reply to this email directly or view
      it on GitHub.










-- 

David VL

@mitchellh
Copy link
Contributor

This is a bug with VirtualBox and not Vagrant. Please read other comments to note working VirtualBox versions!

@lmayorga1980
Copy link

It seems that it still fails on VirtualBox 5.0.10 as well. I guess I will need to rebuild the vagrant box with Packer

@Perni1984
Copy link

for me symbolic link work flawlessly inside synced folders with the following windows host setup:

Host OS: Windows 10 1511
VirtualBox: 5.0.10
Vagrant: 1.7.4

Guest OS: ubuntu/vivid64 (make sure you use a guest linux with kernel version > 3.18!)
VBGuestAdditions: 5.0.10

They key was to use smb for mounting the synced folder, enforcing SMB 3.02 and enabling mfsymlinks:

config.vm.synced_folder "/projectfolder/www", "/var/www", type: "smb", mount_options: ["vers=3.02","mfsymlinks"]

Additionally we should get better speeds with enforcing SMB 3.02 over SMB1 (which is used as default), but I have not made detailed measurements yet. Node.js now works flawlessly and fast inside my boxes.

@c094728
Copy link

c094728 commented Jul 21, 2017

I found a solution to allow creating symbolic links on a shared folder in linux client when host is windows.
It fixed my yum install issues.
https://blog.puphpet.com/blog/2015/06/25/windows-symlinks/

@g105b
Copy link

g105b commented Feb 12, 2018

To fix this issue:

  • Open Local Security Policy
  • Navigate to: Local Policies -> User Rights Assignment
  • Open "Create Symbolic Links"
  • Add your username (or a group you are assigned to)
  • Restart PC

No need to add freeware rinkydink software to your build process.

@tonypino
Copy link

Thank you @g105b - this resolved the issue completely for me.

@Sadegh-Ameri
Copy link

If you don't want to change Local Security Policy, you can follow these step to create the symbolic links.

  1. As your current user, run vagrant halt
  2. Open a console with administrator privileges (Right-Click->Run as Administrator) and use this console to run the following commands
  3. vagrant up
  4. vagrant ssh
  5. Now you can create your symbolic links, ;)

@loipl
Copy link

loipl commented Dec 15, 2018

Thanks @Sadegh-Ameri, this works for me.

@marxangels
Copy link

Run VirtualBox as an administrator every time?

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests