Where vagrant .box stores in Linux (Centos7) - linux

Note: For creating clone of Vagrant Box
I have created vagrant box for centos from atlas.hasicorp.
`https://atlas.hashicorp.com/matyunin/boxes/centos7'
`[user#localhost vagrant_ssh]$ vagrant init matyunin/centos7' This command creates VagrantFile in vagrant_ssh directory.
[user#localhost vagrant_ssh]$ vagrant up --provider virtualbox. Now this will download this vagrant box.
Now I want to create clone of this vagrant box. I can easy to by doing transfer the .box file to the other machine, add the box and run vagrant up. But I am not able to find the location of vagrant box in Centos 7. In this link, someone mentioned path for vagrant in Mac/linux is ~/.vagrant.d/boxes, but I didn't find this path on Centos7

The box is not stored in the vm but on the host machine, so search for the files on your system
The default path is :
Mac OS / Linux: ~/.vagrant.d/boxes
Windows: C:/Users/USERNAME/.vagrant.d/boxes

Related

Paste to virtual terminal

In a Ubuntu host system I have installed qemu and created a virtual machine with CentOS. The CentOS installation does not have an X server, just a virtual terminal. I would like to be able to copy strings from the host system to the virtual terminal of the virtual machine.
What I found so far is the suggestion to install spice-vdagent. If I understand correctly however, spice-vdagent requires an X server, which I don't have installed.
So, how can I paste strings to the virtual terminal (if possible at all)?
You have to enable clipboard in your virtual machine manager software (VirtualBox or VmWare).
In Vbox you have to install Guest Additions iso. In VmWare you have to enable it in the virtual machine's options.
Run your Vm and run next command:
# yum install spice-vdagent
# chkconfig --add spice-vdagentd
# service spice-vdagentd start

Vagrant takes a long time to mount default shared folder

vagrant 1.9
virtualbox 5.1.12
base box: https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.2/vagrant-centos-7.2.box
Current Laptop: Windows7 on Dell Latitude E7270 with 250gb ssd on bitlocker.
So with that out of the way, I was previously using vagrant with the same version of vagrant, virtualbox and base box on a different computer with a mechanical hdd without bitlocker. Everything is ok until I upgraded my laptop.
In vagrant if we do vagrant init in a folder and launch vagrant it will mount the folder with the VagrantFile to the /vagrant on the guest machine. On the current laptop it takes a loong time for vagrant to mount this shared folder.
Do you think its bitlocket that might be causing this issue?
Thanks

Vagrant ssh prompts 'no kex alg' and I'm unable to connect to the virtual machine

I'm trying to connect to a vagrant with a command vagrant ssh as instructed in the official vagrant documentation. Earlier I used older ubuntu as a virtual machine: config.vm.box = "hashicorp/precise32". During that time, issuing a command vagrant ssh did let me connect to the machine with just a username and password.
Now I changed the vagrant box to a newer one because I wanted newer nodejs. Currently, the box is: config.vm.box = "ubuntu/vivid32". Now with this box, if I run the vagrant, and try to connect to the machine with vagrant ssh, it does not let me, but instead it will prompt no kex alg. I read somewhere it has to do with authentication using keys. How could I connect to the new ubuntu with vagrant ssh? One option could be to just regularly connect to the box.
I just had this same issue for a couple days a finally found a way to fix this. I know its a old topic but just incase other people will experiance the same issue. this is how you can solve it:
edit your sshd_config and add:
KexAlgorithms diffie-hellman-group1-sha1
this is what fixed it for me (obviously restart ssh after that)
I guess something was done wrong in the box - when you look the history https://vagrantcloud.com/ubuntu/boxes/vivid32 there has been a few boxes released in short time. I just downloaded the box today and it is working as expected.
I suggest you update the box and you will get the latest version
vagrant box update --box ubuntu/vivid32
Checking for updates to 'ubuntu/vivid32'
Box 'ubuntu/vivid32' (v20151001.0.0) is the latest version
you should go to your vagrant using putty or anything
after that
sudo nano /etc/ssh/sshd_config
go to bottom line and put
KexAlgorithms diffie-hellman-group1-sha1
after that ctrl+o and enter and ctrl+x
go back to your windows and reload vagrant
then try
ssh vagrant#127.0.0.1 -p 2222
Hope this help you

How can I mount a folder from an ubuntu virtual machine on ubuntu?

I tried sshfs, but the local directory where I want to mount a folder from the VM does not open after running the command.
Install the Guest Additions on the virtual machine. These can be dowloaded from within the virtual machine from the Devices > Install Guest Additions menu.
Add the folder you wish to share to the Shared Folders, this option can also be found in the Devices menu.
The folder can now be mounted with
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) folder ~/host
For more info, or troubleshooting, check out this Ubuntu Help article.

VirtualBox: mounting shared folder fails during start-up, but succeed from shell

Problem description:
When I boot my VirtualBox Guest OS, the mounting of the shared file-system - which is referenced in /etc/fstab - fails.
However, after login - mount -a succeeds.
Details:
The boot process gets stuck here ...
... and pressing s continues the boot process, which finishes.
In the shell, I verify that my shared directory is not mounted:
But now, from the shell, the mount of the shared file-system succeeds:
What should I do to make my mount succeed during start-up?
Environment:
VirtualBox: 4.3.12.r93733
Host OS: Windows 7
Guest OS: Linux ubuntu 3.13.0-32-generic #57~precise1-Ubuntu x86_64 GNU/Linux
/etc/fstab
Relevant lines in /var/log/boot.log
You don't have to mount it, VitrualBox will make it for you. For me,these steps worked on my System (VirtualBox 5.0.10 on Windows 7 and Kubuntu 14.04 guest system):
In VirtualBox, configure your shared folder for your machine under 'Shared Folder'. Pick up the directory on your host system (e.g. D:\shared) and set a name for your guest system (e.g. shared).
Boot the guest system. Now you should have a mounted folder under \media\sf_shared.
Thats all. VirtualBox manages this for you.
You need to install VirtualBox Guest Additions properly and use VirtualBox Manager to specify share folders. The issue happens because the mount point is in place with root permissions. The default mount location is in /media/sf_.
You can change mount point with VBoxControl command. To change the mount point from /media/sf_... to /home/user/sf_... use the command:
sudo VBoxControl guestproperty set /VirtualBox/GuestAdd/SharedFolders/MountDir /home/user/
To check if that's working:
sudo VBoxControl guestproperty get /VirtualBox/GuestAdd/SharedFolders/MountDir

Resources