terrywang / vagrantboxes

Handcrafted Arch Linux Vagrant base box with :heart:
249 stars 29 forks source link

/vagrant has no permissions for user vagrant #29

Open ThomasWaldmann opened 7 years ago

ThomasWaldmann commented 7 years ago

vm.box = "terrywang/archlinux"

$ vagrant ssh arch64
Last login: Mon Feb  1 12:15:15 2016
vagrant@archlinux:~$ cd /vagrant/
-bash: cd: /vagrant/: Permission denied
ThomasWaldmann commented 7 years ago

btw, other than that minor glitch, the box seems really nice to work with - only had to install virtualenv/pip, everything else was already there. :)

terrywang commented 7 years ago

Just did a quick test, it works fine here with Vagrant 1.9.7 + VirtualBox 5.1.26.

$ vagrant init terrywang/archlinux

$  vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'terrywang/archlinux' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'terrywang/archlinux'
    default: URL: https://vagrantcloud.com/terrywang/archlinux
==> default: Adding box 'terrywang/archlinux' (v3.17.0719) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/terrywang/boxes/archlinux/versions/3.17.0719/providers/virtualbox.box
==> default: Successfully added box 'terrywang/archlinux' (v3.17.0719) for 'virtualbox'!
==> default: Importing base box 'terrywang/archlinux'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'terrywang/archlinux' is up to date...
==> default: Setting the name of the VM: test_env_default_1501559790300_83206
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /private/tmp/test_env

$  vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

$  vagrant ssh
Last login: Mon Feb  1 12:15:15 2016
vagrant@archlinux:~$  cd /vagrant/
vagrant@archlinux:/vagrant$ ll
total 8
drwxr-x---  1 vagrant vagrant  136 Aug  1 13:52 ./
drwxr-xr-x 18 root    root    4096 Aug  1 13:56 ../
drwxr-x---  1 vagrant vagrant  102 Jul 28 12:56 .vagrant/
-rw-r-----  1 vagrant vagrant 3026 Aug  1 13:52 Vagrantfile

vagrant@archlinux:/vagrant$  pwd
/vagrant

mode bits are as below, looks good to me...

drwxr-x---   1 vagrant vagrant   136 Aug  1 13:52 vagrant/

Thanks for using the box (and your appreciation), it was created for my own learning and testing purpose, didn't expect it be reused by so many people ;-)

ThomasWaldmann commented 7 years ago

I suspect it works for you because you use shared folders and the permissions you see are part of the mounted filesystem. I use rsync for unidirectional sync host -> vm, so there is no fs mounted on /vagrant.