Hot answers tagged

34

From the documentation: src, path of the file to link to (applies only to state=link). Will accept absolute, relative and nonexisting paths. Relative paths are not expanded. You need to use src and dest when using state=link, not path. You also need to invert your source and destination, which appear to be the wrong way around (assuming that you really ...


29

You can set the MySQL root password in your bootstrap file by adding debconf-set-selections commands before running your apt-get install: #!/usr/bin/env bash debconf-set-selections <<< 'mysql-server mysql-server/root_password password MySuperPassword' debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ...


25

According to vagrant's documentation, the default provider should be virtualbox, and the VAGRANT_DEFAULT_PROVIDER variable lets you override it. However, VAGRANT_DEFAULT_PROVIDER is empty, so it should be virtualbox, right? Well, if I set the variable to virtualbox, it works again. So I guess fedora sets the default variable somewhere else. Solution: $ ...


22

The vagrant-disksize plugin makes this easy. Create a debian-9 vm with a 20gb hard drive. minimally: Vagrant.configure("2") do |config| config.vm.box = "debian/stretch64" config.disksize.size = "20GB" end or, using auto-install logic for the plugin: Vagrant.configure("2") do |config| required_plugins = %w( vagrant-vbguest vagrant-disksize )...


20

after spending time with vagrant i got the solution for custom box. first of all install any Linux OS in libvirt/qvm and login to it for customization and create vagrant user with password vagrant adduser vagrant vagrant user should be able to run sudo commands without a password prompt sudo visudo -f /etc/sudoers.d/vagrant and paste vagrant ALL=(ALL) ...


12

A file can be deleted while it's open by a process. When this happens, the directory entry is deleted, but the file itself (the inode and the content) remain behind; the file is only really deleted when it has no more links and it is not open by any process. NFS is a stateless protocol: operations can be performed independently of previous operations. It's ...


11

After a few grueling hours I made headway Vagrant.configure("2") do |config| config.ssh.private_key_path = "~/.ssh/id_rsa" config.ssh.forward_agent = true end config.ssh.private_key_path is your local private key Your private key must be available to the local ssh-agent. You can check with ssh-add -L, if it's not listed add it with ssh-add ~/.ssh/...


11

Vagrant does not keep any logs. The output of, for example vagrant up --debug, can be redirected to a file like vagrant up --provision --debug &> debug_log Fragment from an IRC session in #vagrant at Freenode: [18:29] <NikosA> ada: really, where is the debug "file" stored, by default? Isn't there any? [18:29] <ada> vagrant does ...


9

In general (ignoring vagrant or other system-specific details) your best bet is to set up authentication with SSH keys, and run ssh-agent. Then open the ssh sessions with something like: # load the key to the agent with a 10 s timeout # this asks for the key passphrase ssh-add -t10 ~/.ssh/id_rsa for x in 1 2 3 ; do ssh .... done Or, if you can't ...


8

It's not possible unless you know the UUID of the disk in question. If you did, you would need to have the following in your Vagrantfile: Vagrant.configure("2") do |config| # ... (other config) config.vm.provider "virtualbox" do |vb| vb.customize ["modifyhd", "disk id", "--resize", "size in megabytes"] end end where "size in megabytes" is the HD ...


6

I think Resolving some common issues of this may help you. And this is the essential part Increase Disk space Normally (sadly), cloud base box comes with VMDK disks formats. If you are lucky and your disk format is VDI, you can solve this directly like this. But, VMDK can't be expanded, so you need to add another disk to your VM. If making this manually ...


5

I found the solution for my problem. The plugin is called vagrant-libvirt NOT libvirt The installation of vagrant-libvirt fails too. I found this line in ~/.vagrant.d/gems/extensions/x86_64-linux/ruby-libvirt-0.6.0/mkmf.log: gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory The solution for this problem is easy: dnf ...


5

I have the same problem on Windows 10 Home 64bit with Creators Update, Vagrant 1.9.6, VirtualBox 5.1.22r115126 and Cygwin. Following https://github.com/mitchellh/vagrant/issues I read that this can happen with cygwin/babun/gitbash but not with the cmd-prompt. So I booted another box with the Windows cmd-prompt and yes, I can confirm that after vagrant up ...


5

After rebooting a couple of times, I decided to try my luck launching "VMware Fusion" before invoking the vagrant up command. It indeed works; vagrant up does not start VMWare fusion, and so, you have to be running it for vagrant up to be able to deploy a VM. Ultimately, the error message could be more elucidative.


4

This is just my experience on encountering this problem. On executing vagrant up, i got this The provider 'libvirt' could not be found, but was requested to back the machine 'default'. Please use a provider that exists. I tried the commands provided above echo "export VAGRANT_DEFAULT_PROVIDER=virtualbox" >> ~/.bashrc source ~/.bashrc Then I ...


4

How I did this in Vagrantfile. For people searching ... ubuntu.vm.provider "virtualbox" do |virtualbox| virtualbox.name = "Ubuntu_1510_#{Time.now.getutc.to_i}" virtualbox.customize [ "storagectl", :id, "--name", "SATAController", "--controller", "IntelAHCI", "--portcount", "1", "--hostiocache", "on" ] virtualbox....


4

I'm running a Windows 10 development environment (cygwin/babun + mintty) and had the same issue after upgrading Vagrant. While I haven't found a solution to the problem using vagrant ssh, I did find a workaround. Turns out, I'm able to ssh into the virtual environments normally. Look at the assigned IP address in your Vagrantfile, say, 172.0.0.101. If you ...


3

You might want to look into Puppet - it is excellent for installing and configuring software automatically. There's also a MySQL module, but I haven't tried it.


3

This vagrant plugin it fixed the problem for me: vagrant-triggers you can run your provision script after vagrant up your VM: config.trigger.after :command, :option => "value" do run "script" ... end and don't forget to add sudo to your commands.


3

Because you are piping your wget to a new shell, the environment is not preserved. To prove this, try the following from inside your vagrant box root@lucid32:~# export PATH=$PATH:/foo root@lucid32:~# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/vagrant_ruby/bin:/foo Now run the same command as a different user root@...


3

This appears to work: # VBoxManage hostonlyif remove vboxnet0 This removes the host-only network. Then restarting VirtualBox brought the interface back and it works. For now. Honestly, I don't know if I've actually found the solution or if it's just dumb luck and it will stop working in a few minutes.


3

I understand you need to resolve for dynamically assigned addresses. I had the same issue and used DNSMASQ, this is an integrated DNS & DHCP server that runs very well on ubuntu server. Great benefit is that it is nearly zero config. How I set it up: NAT - SRV01 - InternalNet - SRV02 / SRV03 / CLNT So SRV02 / SRV03 / CLNT are only connected to ...


3

The process appears to be: create a new partition in your newly available free space; your choice of filesystem doesn't much matter, as we will change it later reboot into the system use cfdisk to flag the new partition as Linux LVM instead of whatever you chose above use pvcreate to flag your new partition as a physical volume for LVM use vgextend to add ...


3

The simplest solution for this specific question is to provide the password in the mysql commands parameters as follows: echo "CREATE DATABASE database_name" | mysql -u root --password=your_password This provides the mysql with the password before it even gets to ask for it.


3

Did you check your /etc/network/interfaces config files ? Maybe you have several gateways as pointed here . Anyway, tweaking that file a bit and playing with ifconfig can help you drag the problem out. Check the permissions also, I doubt it comes from there but still :/ You can try to go back to a simpler configuration in /etc/network/interfaces if it's ...


3

Since you are using vagrant you can simply run vagrant ssh to ssh to the box without having to enter a password. This will also handle port collisions if you have more then one vagrant box running and various other things. Alternatively you can use tmux instead of gnome-terminals and make use of its synchronize-panes feature: #!/bin/bash tmux_name="...


3

The approach would be to use key authentication, it is safer, and solves the authentication problem. Just generate a key pair with: ssh-keygen -t rsa And copy/paste the content of ~/.ssh/id_rsa.pub file to the ~/.authorized_keys in the server machine. If the file doesn't exist, check the permissions to user only. If you use multiples terminals I ...


3

You need to install the vagrant-share plugin: [birdsnest ~]% vagrant plugin install vagrant-share Installing the 'vagrant-share' plugin. This can take a few minutes... Fetching: vagrant-share-1.1.6.gem (100%) Installed the plugin 'vagrant-share (1.1.6)'! [birdsnest ~]% vagrant list-commands Below is a listing of all available Vagrant commands and a brief ...


3

Had the same problem. Noticed my VirtualBox does not have 64bit Linux in the option list. Try goto Bios and enable Intel Virtualization Technology. Works for me.


3

If I understand you correctly, apache2 is prompting for the password to unlock the TLS private key you use for HTTPS? If you don't want that extra security on expense of usability, your best option is to remove the password from the key as described here: stop apache from asking for SSL password each restart You can also provide the password via a file and ...


Only top voted, non community-wiki answers of a minimum length are eligible