Category Archives: Virtualization

WSL2 – Adding distro not in store

What if you wanted to add an older linux distro to your WSL2 bullpen? Visiting https://docs.microsoft.com/en-us/windows/wsl/install-manual#installing-your-distro will show you a large number of options where you can download the appropriate .appx file.

This will cause the <distro>.appx packages to download to a folder of your choosing. Follow the installation instructions to install your downloaded distro(s).

If you’re using Windows 10 you can install your distro with PowerShell. Simply navigate to folder containing the distro downloaded from above, and in that directory run the following command where app_name is the name of your distro .appx file.PowershellCopy

Add-AppxPackage .\app_name.appx

If that doesn’t work as expected, you could try any of these links that will get the distro from the Microsoft Store

he following links will open the Microsoft store page for each distribution:

Virtualbox – Your VM has become “inaccessible

Today, when I tried to boot up my linux virtualbox, I got this error:

C:\home\linux>vagrant up
Bringing machine 'default' up with 'virtualbox' provider... Your VM has become "inaccessible." Unfortunately, this is a critical error with VirtualBox that Vagrant can not cleanly recover from. Please open VirtualBox and clear out your inaccessible virtual machines or find a way to fix them.

That doesn’t sound good. A bit of googling around let me to this solution., which I’ll break down into the steps that worked for me.

In my “C:\Users{user}\VirtualBox VMs{vm-id}” folder are two files

  • {vm-id}.vbox-prev
  • {vm-id}.vbox-tmp

Renaming “{vm-id}.vbox-tmp” to “{vm-id}.vbox”

Then try running “vagrant up”

BOOM. It was that easy.

Moving over VirtualBox/Vagrant the easy way

There is a right way to move/copy over a VirtualBox to a new computer/colleague/etc.

Step 1 – Package up the old box

Run a command prompt and switch into the directory that contains the Vagrant box that you want to copy.

NOTE: Make sure that the box has been properly shutdown/powered off from VirtualBox manager.

vagrant  package  --output  project_20XX_XX_xx.box

==> default: Exporting VM...
   (about 10 minutes passed)
==> default: Compressing package to: c:/home/project_20XX_XX_xx.box
   (about 7 more minutes passed)
   (then complete.  Back to c:\

On my ThinkPad X1 Carbon with Intel I7-6600 CPU @2.7 GHz and 16GB ram, it took xyz minutes to create a xxx GB .box file.

Step 2 – Copy the .box file

Next, copy over the c:/home/project_20XX_XX_xx.box to the computer/directory you want it in. You might need

 vagrant  box  add  project  project_20XX_XX_xx.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'project' (v0) for provider:
    box: Unpacking necessary files from: file://c:/home/project_20XX_XX_xx.box
    box: Progress: 100% (Rate: 104M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'project' (v0) for 'virtualbox'!

Next, fire it up

vagrant  init   project
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.


vagrant  up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'jbv2'...
Progress: 90%
==> default: Machine booted and ready!

SSH in and you are good to go.

Moving over VirtualBox/Vagrant the hard way

There is a right way to move/copy over a VirtualBox to a new computer/colleague/etc.

And then there is the hard way.  What is the hard way?  The hard way is when you need to manually copy over .vbx and .box files and edit .xml files. 

Step 1 – Copy files over from the old drive.

Copy over the directory that contains the .vagrant folder. The way I have my environment it’s “c:\home\blah”.  I do by having 2 windows explorer windows open, and dragging and right-clicking on the destination folder, then clicking “Copy here” or “TerraCopy here.”

Take note of the value of c:\home\blah\.vagrant\machines\default\virtualboxes\id

067c8f42-0e93-4825-a02a-8ecf3a6586d3

Next, copy over the c:\Users\YOURNAME\VirtualBox VMs\xxx folder that corresponds/correlates to your Vagrant box.

Then, double click on the .vbox file in the directory you just copied over. This should automatically import it into VirtualBox.

Finally, open up c:\Users\YOURNAME\.VirtualBox\VirtualBox.xml and check that the uuid matches.

      <MachineEntry uuid="{aaaaaaa-bbbb-cccc-dddd-eeeeeeeeee}" src="C:/Users/YOURNAME/VirtualBox VMs/xxx/xxx.vbox"/>
    </MachineRegistry

Fire up your cmd prompt, switch to the c:\home\xxx\ directory and

vagrant up

Celebrate!