About This Blog and My Setup

· by Vincent De Smet · Read in about 3 min · (511 Words)

This blog is meant for those notes I feel confident enough about to release them into the wild. Feel free to review and use what you like.

The static website was generated using Hugo, which is blazingly fast and easy to deploy (even on Windows). I am in fact still using Windows, which seems to be rare for Developers these days… However, at the time of writing this post - the Oculus Rift CV1 is only supported on Windows, so… there’s that.

I’m using the hugo-bootstrap theme and I felt the author’s personal blog source is very useful as an exampleSite as well.

I’m currently using Windows 10 with git-for-windows and ConEmu. git-for-windows provides me an ssh client, agent and key generator - so I do no longer need putty/puttygen and pagent. vim is also included, and I’m trying to get used to it, but I still prefer to use Sublime Text.

The Windows edition I have comes with Hyper-V, so I’m using that instead of Virtual Box / VMWare / …

Hyper-V does not have a proper NAT / DHCP solution, so I’m cheating a little as I still need the excellent VMWare vmnat.exe and vmdhcp.exe services. I install VMWare Player just for these :( - but once Hyper-V is enabled, VMWare will refuse to work. Setting up Virtual Switches and using ICS is impractical. Switching between the Ethernet and Wifi adapters requires you to go to control netconnections and share the connected adapter… just… no

I feel there must be a way to just get the dlls and run regsrv32, put the config files where they are expected, create some registry keys and you should be good to go. I also had to download VM Workstation installation archive and extract vmnetcfg.exe from the installation package to have a decent network configuration utility, but once that’s done - working with Hyper-V became a breeze.

I generally list my Virtual Machines using PowerShell as follows:


and start my Virtual Machines like this:

$vm = Start-VM ubuntu  -Passthru

I may monitor the connection process through the vmconnect.exe program (Which has to be on the Path)

vmconnect $env:COMPUTERNAME $vm.Name -G $vm.Id

Once the Linux VM booted, I switch over to git-bash

I have a problem with finding the IP addresses leased to my VMs, but discovered that the VMWare DHCP service stores the leases on disk under $ProgramData/VMWare/vmnetdhcp.leases

I made a little function & alias in my ~/.bashrc as follows:

function fnc_getVMleases {
	cat $ProgramData/VMWare/vmnetdhcp.leases | egrep -o 'lease.*{|client-hostname.*;' | awk '{print $2}' | xargs -n 2 | cut -d ';' -f 1 | awk '!a[$0]++'
alias lvms=fnc_getVMleases

This uses egrep to find lines that either have the lease or client-hostname and print the 2nd column (separated by space), feed that into xargs to combine every 2 lines into 2 columns and get rid of the semicolumn at the end, finally use awk to remove duplicate rows (as there are some when leases are renewed)

I think it could be optimized using sed to define a label of rows to print.