As I mentioned in my previous blog, I have been working on a personal project that allows us to provision a test Vagrant VM that has MySQL 8 Community Edition installed. The combination between Vagrant and Ansible made this possible.
I put the code up in GitHub for your consumption and feedback.
When you do vagrant init [url], it creates Vagrantfile. The Vagrantfile has the configuration of the Vagrant VM. You can have Ansible file in the Vagrant file to automatically execute when the Vagrant VM starts.
So yeah, please read the README file to start to use it. Any feedback and pull requests are welcome! 🙂
Though I love Linux Mint, I still have my Surface Pro 7 laptop for my personal mobile use. There is nothing I really need Windows for now but I just have it around when I need to be somewhere else to do my personal work.
I’m away from my desk but I want to continue to work on my personal project I started on my Linux Mint. Sure I can continue to do it through SSH in terminal using vim but I want to use my favorite editor like Visual Studio Code. I looked around how I could edit my code remotely. I found Visual Studio Code Remote Development extension. I was able to connect my VS Code on my Windows via SSH and directly edit the files.
I followed an instruction on remote development using SSH and I was able to start to use it. It’s quite easy to follow so I high recommend it!
MySQL Community Server 8.0.28 is freely available from here. I found a documentation on how to install it from scratch using the downloaded binary files. This is interesting… I would like to have all the steps in Ansible and get it installed automatically. It might be my next project… 🙂
I came across a situation where “vagrant up” just wasn’t successful. “vagrant halt” and “vagrant destroy” didn’t do it. I even removed everything from ~/.vagrant.d but it still kept on failing with the following error.
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "/home/hiriumi/.vagrant.d/boxes/oraclelinux-VAGRANTSLASH-7/7.9.289/virtualbox/box.ovf", "--vsys", "0", "--vmname", "OL7U9_x86_64-vagrant-virtualbox-b289_1643606820210_37412", "--vsys", "0", "--unit", "11", "--disk", "/media/hiriumi/extra/OL7U9_x86_64-vagrant-virtualbox-b289_1643606820210_37412/box-disk001.vmdk"]
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Appliance import failed
VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available)
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 1119 of file VBoxManageAppliance.cpp
I even opened VirtualBox to check if a leftover VM was still there but there wasn’t. When I navigated to the directory where VirtualBox creates VMs and there was a directory leftover from the failed instance. I manually removed the directory where VirtualBox stores VM files and did “vagrant up” and then things came back to normal.
I had a chance to learn vagrant at work. It is created by Hashicorp which is the creator of Terraform. I love what they have done. You can easily provision a VM locally and manage them. Looks like it requires VirtualBox as its hypervisor. You may want to install it beforehand. I learned that VirtualBox and Hyper-V can co-exist if you are on Windows.