Issue with vagrant version following the dev guide


(Chagara) #1

helo,

I was following the guide in discourse/VAGRANT.md at master · discourse/discourse · GitHub and I’m running into a couple of issues:

  1. Can someone update the vagrant VM listed in the guide above? I install the latest version of visual box and the tools. I get an error that it has a different version of the tools than the host and fails to finish. I can still ssh and update the box but, as a new person exposed to this steps this can be confusing.

  2. From my understanding this VM tries to mount the local shared where you git cloned the discourse code and ran ‘vagrant up’ from. This failed still even after updating and restarting the VM. I went to the settings in virtualbox and it looks like the auto-mount is off and mounts to /media instead of /vagrant from what I understood the steps in the guide.

  3. The git clone never shows up in /vagrant and I had to do another git clone inside the VM to be able to follow the steps and chown /vagrant to the vagrant user as its owned by root. After that the rest of the steps work :slight_smile:

Please let me know If I made a mistake or took a wrong turn :slight_smile: I’m loving discourse so far. Also with permission I can update the guide posted above and do a PR request if no problems.


(cpradio) #2

Can you post the logs/output for your attempt?

It seems to work fine for me.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'discourse-16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: discourse_default_1467544808688_93034
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 3000 => 4000 (adapter 1)
    default: 1080 => 4080 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    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 its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 5.0.18
    default: VirtualBox Version: 4.3
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /home/cpradio/Server/git/discourse

(Chagara) #3

you have the error in the logs you posted.

default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.

Then it tries to to update the VM but, fails because its already getting updated on the inside. I go inside the VM and do apt-get upgrade then do a restart. The shared files never mount.


(cpradio) #4

But for me, it all ends successfully, the files mount and I can run Discourse. If it still isn’t mounting after you update the guest additions, you have something else going wrong.


(Chagara) #5

Well that’s what I’m trying to figure out. Using ubuntu 16.04 mint latest vagrant and virtualbox


(cpradio) #6

Hmm… not sure, as this topic isn’t far different to the steps you’ve done.


(Chagara) #7

==> default: Machine booted and ready!
[default] GuestAdditions versions on your host (5.0.22) and guest (5.0.18) do not match.
mesg: ttyname failed: Inappropriate ioctl for device
rmmod: ERROR: Module vboxguest is in use by: vboxvideo
mesg: ttyname failed: Inappropriate ioctl for device
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
mesg: ttyname failed: Inappropriate ioctl for device
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
mesg: ttyname failed: Inappropriate ioctl for device
Hit:1 Index of /ubuntu xenial InRelease
Hit:2 Index of /ubuntu xenial-updates InRelease
Hit:3 Index of /ubuntu xenial-backports InRelease
Hit:4 Index of /ubuntu xenial-security InRelease
Hit:5 Index of /chris-lea/redis-server/ubuntu xenial InRelease
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
==> default: Checking for guest additions in VM…
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apt-get update

Stdout from the command:

Hit:1 Index of /ubuntu xenial InRelease
Hit:2 Index of /ubuntu xenial-updates InRelease
Hit:3 Index of /ubuntu xenial-backports InRelease
Hit:4 Index of /ubuntu xenial-security InRelease
Hit:5 Index of /chris-lea/redis-server/ubuntu xenial InRelease

Stderr from the command:

mesg: ttyname failed: Inappropriate ioctl for device
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?


(Mittineague) #8

I was able to set this one up inside a Ubuntu inside VMware player


(Chagara) #9

I searched around and at first It looked like a vagrant bug but, it turns out is a bug in ubuntu 16.04 that has not been fixed yet. I’m not sure what flavor you guys use for your host but, I’m using ubuntu 16.x and the VM used for discourse is also 16.04