How I should install Virtualbox and Vagrant on Lubuntu

256 views
Skip to first unread message

Edgar Oliveira

unread,
Dec 15, 2015, 10:31:14 PM12/15/15
to Vagrant
Hello,

How do I install virtualbox and vagrant on my Lubuntu: Linux 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux?
Because I installed vagrant and virtualbox but I had some problems with permissions through access on website.

How do I install virtualbox on user root or another user? Which "script" I should use?

Thanks

Alvaro Miranda Aguilera

unread,
Dec 16, 2015, 12:15:18 AM12/16/15
to vagra...@googlegroups.com
Hello,

DEB files you install from the each download site.

Virtualbox and vagrantup.com have deb files.

Once those are installed as your user run:

mkdir precise64
cd precise64
vagrant init -m hashicorp/precise64
vagrant up


Alvaro
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/843d256b-5a30-497c-99da-1be6cc2c55b3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Edgar Oliveira

unread,
Dec 16, 2015, 6:27:30 AM12/16/15
to Vagrant
Hello Alvaro,

Thanks a lot for your reply,

Ok, I think can do this. But first I liked clean my system, because I installed the virtualbox and another things (stuff relative virutalbox, because I am a newbie) and when I turned on my computer I received an error referent Vbox Headers. Unfortunately I didn't copy this message error, only report that to the community (through the message error box). But so, How I should clean (uninstall) all components relative VirtualBox and Vagrant and start up again?

Some question:
  1. Which user I selected to install the vagrant and virtualbox? I choose root because when I will install these programs the system asked me by password root.
  2. If I choose install vagrant and virtualbox through root or another user how I run the commands relative vagrant (vagrant init and vagrant up)?
Thanks

Edgar Oliveira

unread,
Dec 16, 2015, 3:19:21 PM12/16/15
to Vagrant
Hello,

I changed the SO, turn Linux Mint but version Mate!

Result command uname -a: Linux 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Installed the Virtual Box, through Software Manager (result command: ede@ede ~/Documents/01 $ virtualbox --help | head -n 1 | awk '{print $NF}' = 5.0.2). And installed Vagrant trough file .deb (vagrant_1.7.4_x86_64.deb) - (result command: vagrant -v = Vagrant 1.7.4).

After this opened my terminal and execute this command:

ede@ede ~/Documents/01 $ vagrant init -m hashicorp/precise64
Vagrant is upgrading some internal state for the latest version.
Please do not quit Vagrant at this time. While upgrading, Vagrant
will need to copy all your boxes, so it will use a considerable
amount of disk space. After it is done upgrading, the temporary disk
space will be freed.

Press ctrl-c now to exit if you want to remove some boxes or free
up some disk space.

Press the Enter or Return key to continue.
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
ede@ede ~/Documents/01 $ ls
Vagrantfile
ede@ede ~/Documents/01 $ ls -la
total 12
drwxr-xr-x 2 ede ede 4096 Dec 16 20:09 .
drwxr-xr-x 3 ede ede 4096 Dec 16 20:05 ..
-rw-r--r-- 1 ede ede   77 Dec 16 20:09 Vagrantfile
ede@ede ~/Documents/01 $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise64'
    default: URL: https://atlas.hashicorp.com/hashicorp/precise64
==> default: Adding box 'hashicorp/precise64' (v1.1.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box
==> default: Successfully added box 'hashicorp/precise64' (v1.1.0) for 'virtualbox'!
==> default: Importing base box 'hashicorp/precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Setting the name of the VM: 01_default_1450296704245_93043
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.

The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
ede@ede ~/Documents/01 $

What I do wrong?
Thanks

Alvaro Miranda Aguilera

unread,
Dec 16, 2015, 6:38:28 PM12/16/15
to vagra...@googlegroups.com
hello,

some wordings are going to be different person to person, so dont take
what i say literally and feel free to replace words like
should/could/must for what you think is more appropiate.

in deb systems, you should not use root,you use your own user, lets say edgar

using edgar user, i assume you are on graphical desktop on a real box
if you are not on a real box, then stop, virtualbox won run inside
other virtulalization tool
you can do nested virtualization, ie vmware inside vmware, virtualbox
inside vmware, but lets keeps simple

once you have downloaded the software, if you double click on the deb
files, it will ask to install, and will ask for sudo password / root
past to elevate privileges and do the install

you can think as will become root install the software and exit

here, for virtualbox to work, you need to have some software
installed, lets calle them pre-requirements

gcc make kernel-headers

with that on the hpost will create some drivers

the error you got is due those modules werent created

here i will suggest check some virtualbox documentation, and see how
to rebuild those modules

then, when that is sorted, as your normal user you should be able to
do vagrant init, vagrant up

let me know if make sense, or if i need to help more

thanks
alvaro
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/1f931dcc-6344-412c-af40-421a294f53be%40googlegroups.com.

pixel fairy

unread,
Dec 26, 2015, 5:20:32 PM12/26/15
to Vagrant
on a linux host, you dont need virtualbox. you can use the libvirt provider and mutate for the virtualbox boxes. libvirt uses kvm which is faster and has nested virtualization.

Edgar Oliveira

unread,
Dec 26, 2015, 5:37:49 PM12/26/15
to Vagrant
Hello,

Thanks for your helps

exist some article or tutorial where explain how install and configure environment vagrant, with virtualbox or any other, on Linux?

Thanks

pixel fairy

unread,
Dec 26, 2015, 7:14:06 PM12/26/15
to Vagrant
run these commands as root to install virtualbox and automatically keep it updated with the rest of the system,

echo deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` contrib > /etc/apt/sources.list.d/virtualbox.list
wget
-q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
apt
-get update
apt
-get install virtualbox-5.0

then install vagrant from https://www.vagrantup.com/downloads.html

now try it. make a folder, cd into and make a file called Vagrantfile with these contents.
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION
= "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config
.vm.box = "ubuntu/trusty64"
  config
.vm.hostname = "vagrantbox"
end

 

then 'vagrant up' and see if it works.

https://docs.vagrantup.com/v2/getting-started/index.html

Edgar Oliveira

unread,
Dec 26, 2015, 8:41:51 PM12/26/15
to Vagrant
Hello,

Thanks to your reply,

I has a version 5.0 of VirtualBox, but I executed all commands. First question:
  1. I should created Vagrantfile who user? Root or another normal user?
 I following this video "https://www.youtube.com/watch?v=PmOMc4zfCSw" and execute "vagrant box add 02 hashicorp/precise32". And after "vagrant init 02" and "vagrant up".

Two things occur:
  1. When execute first time the machine, I actived option vb.gui = true on Vagrantfile to see screen VM, and the machine stopped on Grub. I had to choose the option to the machine can startup;
  2. I just sets four option on my Vagrantfile, please see below. And when I drag and drop file (see calendar.php) on folder data this is file with permission wrong - Why?


What I should do to this run good on Linux?
Thanks

Edgar Oliveira

unread,
Dec 26, 2015, 8:43:46 PM12/26/15
to Vagrant
Sorry, I forgot file:

"# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at

  # Every Vagrant development environment requires a box. You can search for
  config.vm.box = "02"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
   config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
   config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
   config.vm.synced_folder "data", "/var/www/foo"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
   config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
     vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
   end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   sudo apt-get update
  #   sudo apt-get install -y apache2
  # SHELL
end"

Edgar Oliveira

unread,
Dec 26, 2015, 8:48:57 PM12/26/15
to Vagrant
But, If I created the file (example: test.php) inside the VM, through user root, I can execute this file in the browser. The permissions file already look good, look:

Thanks

pixel fairy

unread,
Dec 27, 2015, 6:42:30 AM12/27/15
to Vagrant
after virtualbox and vagrant are installed, do everything else as normal user.
Reply all
Reply to author
Forward
0 new messages