I'm new to Vagrant
I've installed vagrant and vagrant box for ubuntu/xenial64 on my ubuntu machine. (Ubuntu box on Ubuntu host OS)
Inside the vagrant box, I installed openjdk-8, firefox, jenkins.
How do I access the firefox browser UI which is installed in the Vagrant box so that I can have access jenkins server.
After entering into box using vagrant ssh, When I type firefox in vagrant box, it is saying
Error: GDK_BACKEND does not match available displays
Same thing's happening when I try sudo firefox
Here is my vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network :private_network, ip: "192.168.68.8"
end
Vagrant starts VMs in headless mode per default. You can configure it to start with a display by adding this to your Vagrantfile:
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
Then restart the VM.
vagrant reload
Related
Getting a 'vboxsf' error whenever I try to up the centos7 box.
I run vagrant init in the directory.Then I go in directory and edit the file.And run the vagrant up.This is what I put in vagrant file:-
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "Centos7" do |master|
master.vm.provider "virtualbox"
master.vm.box = "centos/7"
master.vm.hostname = "web.mylab.local"
master.vm.network :private_network, ip: "198.168.56.7"
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
master.vm.provision "shell", inline: <<-SHELL
sudo sed -1 "s/PasswordAuthentication.*/PasswordAuthentication
yes/g" /etc/ssh/sshd_config
sudo systemct1 restart sshd
SHELL
end
end
**This is the error message i get:-**
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
mount: unknown filesystem type 'vboxsf'
You are defining a synced_folder (i.e. shared folder) for your VirtualBox vm.
This functionality requires the vm to have the VirtualBox Guest Additions installed
You are using a base box that does not have VirtualBox Guest Additions installed
From there you basically have 3 options
Modify your vagrant provisioning script to install Guest Additions when creating the vm (e.g. Insert the virtual CDROM into vm, mount it and lauch the install script). I still have a doubt this can break in case the shared folder mount happens before provisionning is finished...
Create a base box yourself that will have Guest Additions installed and use it. If you need to share this box with other devs, you will have to host it somewhere.
Use an other base box with Guest Additions already installed.
I did not dig into the latest point for quite a while since I tend to craft my own boxes for my own use. But if I remember well, the public generic/centos7 box comes with Guest Additions pre-installed for the VirtualBox provider.
I have this Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.hostname = "app.local"
config.vm.network :private_network, ip: "192.168.20.20"
config.vm.synced_folder ".", "/vagrant", :mount_options => ['dmode=774','fmode=775']
config.vm.provider :virtualbox do |vb|
vb.name = "MyBox"
vb.memory = 512
vb.cpus = 2
end
config.vm.provision :shell, path: "install.sh"
end
that I used so far without problems (on Ubuntu and Windows). On Windows 10, I have upgraded both Oracle VM Virtual Box (5.1.16) and Vagrant (1.9.2) and now I get this error when trying to install the box:
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o dmode=774,fmode=775,uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
: No such file or directory
I also see this:
GuestAdditions versions on your host (5.1.16) and guest (4.3.36) do not match.
* Stopping VirtualBox Additions
and then it looks like the GuestAdditions is removed and the 5.1.16 version is installed, steps that ends with:
vboxadd.sh: Building Guest Additions kernel modules. vboxadd.sh:
Starting the VirtualBox Guest Additions.
Could not find the X.Org or XFree86 Window System, skipping.
After this, I still get:
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 4.3.36 VBoxService inside the vm
claims: 5.1.16 Going on, assuming VBoxService is correct... Got
different reports about installed GuestAdditions version: Virtualbox
on your host claims: 4.3.36 VBoxService inside the vm claims:
5.1.16 Going on, assuming VBoxService is correct...
Is this a bug or am I doing something wrong?
It looks like this was fixed in 5.1.18. Updating to the latest version fixed the problem for me.
Change Log (Version 5.1.18):
Shared Folders: fixed case insensitive filename access (5.1.16 regression; Windows guests only; bug #16549)
Shared Folders: fixed access to long pathes (5.1.16 regression; Windows guests only; bugs #14651, #16564)
When I execute command Vagrant up its opening hashicorp/precise32 box in command prompt mode even I had mentioned gui = true.
Can we able to access this box/machine in graphical mode/terminal and if yes then what do need to configure.
Vagrantfile -
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.omnibus.chef_version = :latest
config.vm.provision :chef_client do |chef|
chef.provisioning_path = "/etc/chef"
... ...
... ...
end
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
vb.cpus = 1
end
end
Thanks!
The base box that you're using is Ubuntu Server and does not have a desktop environment. So you'll need to install one...
Make sure you have the VirtualBox Extension Pack installed (download here). Then update your Chef provisioning to install the ubuntu-desktop metapackage and try a vagrant provision command (or vagrant up if your box isn't created yet). Provisioning is likely to take a while because Chef will be installing hundreds of packages. Alternatively you could install the xfce4 metapackage instead of ubuntu-desktop. XFCE is much smaller. You may need to vagrant halt and vagrant up in order to get the GUI to launch.
It's my first question I've asked here, but I've been a long time reader of Stack Overflow.
I use Vagrant with VirtualBox to handle the server configurations of the several projects I'm working on. I've used VirtualBox and Ubuntu Mate for the last few months without any problems. But I've changed my hard drive yesterday and I had to reinstall Ubuntu Mate 15.04.
I've installed the build-essential package, VirtualBox 5.0 from the x64 package found on VirtualBox's website and Vagrant from Vagrant's website. I've pulled my old VagrantFile from GIT and relaunched the machine. Vagrant pull the correct image, as expected, but once the VM is running in VirtualBox, Vagrant can't ssh into it.
I used VirtualBox's interface to get into the guest's shell, and found that I could not access any network. Even VirtualBox auto-update tool cannot connect to the internet. I get the message :
The network operation failed with the following error: Unknown reason
I've formated my computer several times using different versions/flavors of Ubuntu to no avail. I've also rolled back to previous versions of VirtualBox, but no luck either. I've manually installed a guest with VirtualBox and the network is not working either.
I've did several searches on Google and Stack Overflow for similar problems, but the closest matches were for Windows 10 issues. But neither the host or the guest is running Windows.
My computer/os configuration is the same as before yesterday, except for the drive change. I don't understand why it isn't working as before.
Here's my VagrantFile if it can help you :
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network "private_network", ip: "192.168.33.15"
config.vm.network "public_network", ip: "10.1.1.207", bridge: "p4p1"
config.ssh.forward_agent = true
config.vm.synced_folder "src/", "/var/www/project",
owner: "www-data", group: "www-data"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "512"]
end
config.vm.provision "shell", path: "bin/shellprovider.sh"
end
Any help or any hint would be greatly appreciated.
Regards,
Eric Lacasse
I am running vagrant on Ubuntu 14.04 and have problem with running windows box http://aka.ms/vagrant-xp-ie8 .
After sudo vagrant up, i constantly see
Waiting for machine to boot. This may take a few minutes...
I ran 'vagrant up --debug 2>log' , and it looks like
this
Vagrant.configure(2) do |config|
config.vm.box = "http://aka.ms/vagrant-xp-ie8"
config.winrm.username = 'IEuser'
config.winrm.password = 'Passw0rd!'
config.vm.communicator = "winrm"
config.vm.network "public_network"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
end
Do you have idea how to fix this?
I've had similar issues when setting up Windows guest VMs. I was using the IE11/Win7 VM from http://modern.ie.
Installing the latest version of the VirtualBox guest additions resolved it for me under OSX. Under Windows, I also turned on hardware virtualization in my BIOS.