Skip to main content

Posts

Showing posts from March, 2020

Git: Move Subdirectory to New Repository

I recently published my  Brief emulation mode for Emacs  to the MELPA  Emacs package repository. This is code I wrote well over twenty years ago and have been using daily since. I hadn't published it before partly because it was languishing in a sub-directory of my main Emacs repo (and partly because I never had the time before). To become a package in its own right though, it had to have its own repo. Splitting out a subdirectory to a new repo used to be a complex task in Git (usually involving complicated invocations of git filter-branch) , but these days it's reasonably straightforward with the git subtree command (well at least as straightforward as anything else in Git 😀). The other reason I like the subtree method is it's non-destructive - you can back out at any point and still get back to where you started, plus all the history is retained. Here's how it works: Step 1: Create a new branch in the main repo with just the sub-directory commits $ cd <

VirtualBox: How To Shrink VDI File

One area where Parallels is much better than VirtualBox is in the ease of compacting a VM disk to what's actually in use. I've found that VM disks just keep increasing in size, regardless of what you might delete. Parallels makes compacting easy - all you do is select " Shrink... " from the Parallels menu. The situation with VirtualBox is more complicated 😀 While there is a command line "compact" option, this relies on unused stuff being zero - which it won't be for things that got deleted... However there is a tool ( zerofree ) which you can run in the VM and it sets all the free space on the disk to zero, which can then be compacted in VirtualBox. Here are the steps I've been using: Step 1: Install zerofree in the VM (Linux in my case): $ sudo apt install zerofree Step 2: Empty Trash and delete unneeded files Step 3: Boot into a recovery session Enter root password. Step 4: Remount disk as read-only # mount -n -o remount,

VirtualBox: Install Guest Additions in Linux VM

As mentioned in my previous post, I found VirtualBox pretty easy to install and make work. My only real difficulty was figuring out how to install the "Guest Additions" on Linux, as this is poorly documented. The "Guest Additions" are the VirtualBox equivalent of the " *-tools " of the commercial VM's and provide closer integration between the VM and host environment, so you usually want to install them. Here are the steps I used to install the "Guest Additions" on Debian 8 & 9 with VirtualBox 6.1.*: Step 1: Prepare for building a kernel module $ sudo apt-get install build-essential module-assistant $ sudo m-a prepare Step 2: Run the Guest Additions install Click the VirtualBox Devices menu on the VM. Click " Insert Guest Additions CD image... " Run the installer: $ mount /media/cdrom $ sudo sh /media/cdrom/VBoxLinuxAdditions.run $ sudo reboot Step 3: Fix permissions issue with  shared  folders U

Convert Parallels Disk to VirtualBox VDI

I used to use the free Parallels Desktop Lite on the Mac App Store to host various Linux virtual machines for software testing purposes. Although I'd heard things about the company's business practices, I thought it was a pretty fair deal allowing people to run free OS's for free - you only had to pay to run Windows. However about a year ago they introduced a mandatory subscription (at £74 per annum) even to run Linux, in the guise of a normal software update. None of this was mentioned in the update info - Nice 😡 No worries I thought (this is the polite version) - I'll just restore the previous version from Time Machine and Bob was indeed my uncle. This plan worked fine until I upgraded to Catalina and sure enough Parallels would no longer run. Rather than pay the Parallels ransom, I decided to investigate the alternatives. After some research I settled on VirtualBox, a free open-source VM from Oracle. VirtualBox was surprisingly easy (for an open-source pro

New Start

As we're all in Lockdown for the foreseeable future, I decided to reactivate my (long neglected) blog and also to widen the scope to include my musings on tech subjects, as well as photographic ones 😀 Part of the reason is also my photographic stuff is really concentrated at  Flickr , 500px  and my  Portfolio website .