Parallels / vagrant-parallels

Vagrant Parallels Provider

Home Page:https://parallels.github.io/vagrant-parallels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't mount /vagrant path if VM path contains "й" character

m-emelchenkov opened this issue · comments

Subj. Steps to reproduce:

  • Create path "/Users/[user]/Йокарный Бабай".
  • cd "/Users/[user]/Йокарный Бабай".
  • vagrant init bento/ubuntu-20.0.4.
  • vagrant up

You'll found that /Users/Mikhail will be mount under "/vagrant", not "/Users/Mikhail/Йокарный Бабай", as expected.

Why? Because UTF-8 is, generally speaking, a piece of sh*t. Anyone who has worked closely with this encoding realizes what the hell it is. I.e. remember rsync, when syncing files with "й" from Mac to Linux? There is a special option "--iconv=UTF-8-MAC,UTF-8", or everything will fail. So please check if possible to fix it in your plugin, I hope so.

macOS 10.13.6, vagrant 2.2.16.

Hi @m-emelchenkov
I made a test on my machine and it works just as expected. Let's go into the details:

Environement

  • macOS Big Sur 11.3.1
  • Parallels Desktop for Mac 16.1.2
  • Vagrant 2.2.16
  • vagrant-parallels 2.2.1

Steps what I did

  1. I created a new dir
mkdir -p "~/Workspace/Йокарный Бабай"
  1. Then initiated a new vagrant configuration:
vagrant init -m bento/ubuntu-20.10

so, the Vagrantfile looks like this:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-20.10"
end
  1. Run vagrant up. That's what is shown in the output:
$ vagrant up 

<...skipped...>
==> default: Mounting shared folders...
    default: /vagrant => /Users/legal/Workspace/Йокарный Бабай

^ The host path looks correct
4. I Double-checked the content of the dir from the guest:

$ vagrant ssh -- ls -la /vagrant
total 16
drwxr-xr-x  1 vagrant vagrant  128 May 14 11:59 .
drwxr-xr-x 21 root    root    4096 May 14 11:45 ..
drwxr-xr-x  1 vagrant vagrant  160 May 14 11:35 .vagrant
-rw-r--r--  1 vagrant vagrant  120 May 14 11:59 Vagrantfile

^ That's the expected content of the mounted directory, not the parent one.


So, if you did the same test on your side, but still see the issue, let's check the following:

  1. What is version of Parallels Desktop you are using? (prlctl --version)
  2. What mount path is shown in the output of vagrant up in your case
  3. What is shown in the section "Host Shared Folders" in the output of prlctl list -i <VM_ID> --json ? You can get the VM_ID either from the output of prlctl list -a and it is also stored in the file ./.vagrant/machines/default/parallels/id.
    Here is the sample of what I mean:
$ cat ./.vagrant/machines/default/parallels/id
092752b7-ded5-414c-8c4c-c1728420d1d6⏎

$ prlctl list -i 092752b7-ded5-414c-8c4c-c1728420d1d6 --json

<...skipped...>
		"Host Shared Folders": {
			"enabled": true,
			"vagrant": {
				"enabled": true,
				"path": "\/Users\/legal\/Workspace\/Йокарный Бабай",
				"mode": "rw"
			}
		},

Hi @legal90!

Apple makes me LOL :-). You created a folder from Terminal (I tried it too, it works). I created from Finder. When the folder created from Finder, it seems, it gets different encoding than when creating the same folder from Terminal. Try to create it from Finder. If it will works for you, then it means Apple fixed it one of macOS versions above High Sierra.

PS: Parallels version is the same as yours.

I reproduced the issue with the folder created in Finder. That's true - the Й character is encoded differently when its created in Finder, rather when it's created in terminal (in my case: iTerm2 + fish shell).

I investigated it a bit more and found that the "cropped" path is coming from Vagrant level, so we can't do anything with that on our plugin side. I found the similar issue reported in the upstream Vagrant: hashicorp/vagrant#10225

I'm gonna close this issue since it's coming from the upstream Vagrant. It could be tracked here: hashicorp/vagrant#10225