![]() On this page Oracle publishes Vagrant boxes based on Oracle Linux. Vagrant Boxes are pre-built base images that can be imported into Vagrant as a starting point. box.imgĪdd box to vagrant vagrant box add -name custom custom_box. Vagrant is a tool to manage virtual machine-based development environments. ![]() because it takes input with name box.img by default.Ĭreate box tar cvzf custom_box.box. so, don't change the format just rename to box.img. Note: currently,libvirt-vagrant support only qcow2 format. Rename ubuntu.qcow2 to box.img mv ubuntu.qcow2 box.img now, come to host machine on which guest VM is running and goto the /var/lib/libvirt/images/ and choose raw image in which you did the change and copy somewhere for example /test cp /var/lib/libvirt/images/test.img /testĬreate two file metadata.json and Vagrantfile in /testĪnd in Vagrantfile nfigure("2") do |config|Ĭonvert test.img to qcow2 format using sudo qemu-img convert -f raw -O qcow2 test.img ubuntu.qcow2 Install additional development packages for the tools to properly compile and install sudo apt-get install -y gcc build-essential linux-headers-serverĭo any change that you want and shutdown the VM. Restart ssh service using sudo service ssh restart Open sudo vi /etc/ssh/sshd_config and change PubKeyAuthentication yesĪuthorizedKeysFile %h/.ssh/authorized_keys Put ssh key from vagrant user mkdir -p /home/vagrant/.sshĬhmod 0600 /home/vagrant/.ssh/authorized_keys ![]() Vagrant user should be able to run sudo commands without a password prompt sudo visudo -f /etc/sudoers.d/vagrantĭo whatever you want to customize your vagrant box and install openssh-server if not installed previously sudo apt-get install -y openssh-server After spending time with vagrant i got the solution for custom box.įirst of all install any Linux OS in libvirt/qvm and login to it for customization and create vagrant user with password vagrant adduser vagrant
0 Comments
Leave a Reply. |