recentpopularlog in

kme : vagrant   45

vagrantfile - Print message after booting vagrant machine with "vagrant up" - Stack Overflow | https://stackoverflow.com/
Vagrant now has builtin support for a message to appear after vagrant up. Just add this to your Vagrantfile:

<code class="language-ruby">config.vm.post_up_message = "This is the start up message!"</code>

And then after your VM has come up you'll see this message in green:

<code>==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: This is the start up message!</code>
vagrant  vagrantfile  provisioning  configfile  solution 
may 2018 by kme
Basic Usage - Synced Folders - Vagrant by HashiCorp
Modifying the Owner/Group

By default, Vagrant mounts the synced folders with the owner/group set to the SSH user. Sometimes it is preferable to mount folders with a different owner and group. It is possible to set these options:

config.vm.synced_folder "src/", "/srv/website",
owner: "root", group: "root"


Mount options for mount.vboxsf:

uid=UID
set the default file owner user id to UID

gid=GID
set the default file owner group id to GID

ttl=TTL
set the "time to live" to TID for the dentry

dmode=MODE
override the mode of all directories to (octal) MODE

fmode=MODE
override the mode of all regular files to (octal) MODE

umask=UMASK
set the umask to (octal) UMASK

dmask=UMASK
set the umask applied to directories only

fmask=UMASK
set the umask applied to regular files only


Source: http://manpages.ubuntu.com/manpages/wily/man8/mount.vboxsf.8.html
vagrant  virtualbox  sharedfolder  permissions  solution 
march 2017 by kme
"Vagrant could not detect VirtualBox!" · Issue #192 · ptwobrussell/Mining-the-Social-Web-2nd-Edition · GitHub
Ran into this once during a workshop; solution was to add the path where the user had installed VirtualBox (it was something odd, like C:\Program Files\Oracle) to the PATH environment variable. Possibly the registry was out of sync with the actually VirtualBox installation path, or maybe Vagrant is hard-coded to look for VBoxManage.exe in only a couple of places on Windows.
windows  vagrant  virtualbox  errormessage  solution 
november 2016 by kme
Fix Vagrant's Authentication failure after re-building the box · GitHub
$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2202
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key
IdentitiesOnly yes
LogLevel FATAL

# generate public key out of new private (-y key)
$ ssh-keygen -y -f /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key > /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key.pub

# copy new identity. will ask for vagran't password, which is `vagrant'
$ ssh-copy-id -i /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key -p 2202 vagrant@127.0.0.1
vagrant  annoyance  errormessage  ssh  publickeyauthentication  solution 
august 2016 by kme
authentication - lxqt polkit asking for root's password when account is locked - Super User
This actually *was* the problem after all. I'd forgotten to add 'vagrant' to the 'sudo' group because he had his own entry in /etc/sudoers.


I managed to get it to work correctly. I wasn't added to the "wheel" group. I fixed it by running:

sudo usermod -a -G wheel [user]

vagrant  sudo  polkit  policykit  ubuntu  xubuntu  annoyance  solution 
may 2016 by kme
Putty Unable to Use Vagrant’s Private Key | A Little of Both
The newer versions of Vagrant (say that they) replace the "insecure private key" with a new, randomly generated one. I dunno whether that means that the ~/.vagrant.d/insecure_private_key has been replaced with the randomly-generated one or not.

If you want to use this key with PuTTY, you need to import the key with PuTTYgen, which seems to modify the key somehow, because I found that I had to copy the public key and re-add it to the ~/.ssh/authorized_keys file on the VM guest.
putty  windows  vagrant  ssh  pubkey  publickkeyauthentication  sortof  solution 
may 2016 by kme
GitHub - jedi4ever/veewee: Easing the building of vagrant boxes
The first step to build a new virtual machine is to download an existing 'base box'. I believe this scares a lot of people as they don't know how these unverified boxes were built. Therefore a lot of people end up building their own base box which is often time consuming and cumbersome. Veewee aims to automate all the steps for building base boxes and to collect best practices in a transparent way.
virtualbox  vagrant  automation  devops  devel 
april 2016 by kme
Vagrant and SSH agent forwarding - http://razius.com/
Adding "ForwardAgent yes" in my ~/.ssh/config seems to have worked as well. Maybe.
vagrant  provisioning  ssh  agentforwarding  maybesolution 
november 2015 by kme
vagrant/CHANGELOG.md at master · mitchellh/vagrant · GitHub
Vagrant v1.1.0 introduced the version 2 Vagrant file format (which I used because I didn't know any better). And, as luck would have it, the Ubuntu 12.04 repositories only have Vagrant v1.0.1.
Vagrantfiles from 1.0.x that do not use any plugins are fully backwards compatible. If plugins are used, they must be removed prior to upgrading. The new plugin system in place will avoid this issue in the future.
Lots of changes introduced in the form of a new configuration version and format, but this is opt-in. Old Vagrantfile format continues to be supported, as promised. To use the new features that will be introduced throughout the 1.x series, you'll have to upgrade at some point.
vagrant  solution  breakingchanges  automation  devops 
september 2015 by kme
apache - Vagrant's port forwarding not working - Stack Overflow
Duh.
I reprint Robert's comment below because it is such a trivial way to check: Run service iptables stop as root to quickly rule out a Guest firewall issue. Reenable it later if needed.
apache  virtualbox  portforwarding  iptables  firewall  centos  vagrant  devops  automation  ansible  solution 
september 2015 by kme
Cannot override default ssh port forwarding · Issue #3232 · mitchellh/vagrant · GitHub
Just do this and it will use 9980 instead of default 2222:
config.vm.network :forwarded_port, guest: 22, host: 9980, id: "ssh"
vagrant  configfile  ssh  portforwarding  devops  deployment  solution 
may 2015 by kme
Building a Vagrant Box from Start to Finish
Has some handy advice not found in the "official" guide, such as filling up the root block device with /dev/zero before packaging the box.
vagrant  virtualization  devops  virtualbox  setupguide  howto 
may 2015 by kme
Can't execute sudo commands on machine that requires tty to run sudo · Issue #1482 · mitchellh/vagrant · GitHub
Just adding "Defaults:vagrant !requiretty" to /etc/sudoers.d/vagrant should be enough.
#cloud-config
write_files:
- path: /etc/sudoers.d/999-vagrant-cloud-init-requiretty
permissions: 440
content: |
Defaults:ec2-user !requiretty
vagrant  ssh  configfile  forreference  solution 
may 2015 by kme

Copy this bookmark:





to read