Virtualization, homelabs, eBay rack servers and a 2008 Mac Pro

I’m fascinated with installing different OSes to see what they’re about. At one point on VirtualBox I had about 20 different VMs with all sorts of guests from OS/2 to many different Linux distros. Somewhere on my internet travels I ran into the Reddit Homelab group, a community of sysadmins who run virtualization on older, used rack servers (and other hardware), to experiment with configuration of VMWare ESXi, and other virtualization software like Proxmox VE.

Window shopping on eBay, you can pick up various used Dell or HP rack servers with dual Xeons and several swappable harddrive bays for around $100 to $200 depending on the specs. I was getting close to picking up one of these, until I wondered if you can run ESXi on a Mac Pro. Turns out you can and it is even supported hardware on VMWare’s HCL list. Trouble is my eBay 2008 Mac Pro is not on the supported list for current ESXi versions, so I’m not sure if a current version would install and work ok, or whether I’d have to go back a few versions.

My MacPro currently has 20GB RAM, and I’ve got 3 empty drive bays. Watching a few YouTube videos such as the ones below, I feel a weekend project coming on 🙂

 

Docker specific lightweight OSes: Installing RancherOS under KVM on Debian

I’ve been playing around with Docker for a while and feel like I’m at the point where I have questions about how I’d scale up and manage my container deployments, so I’m interested to check out some Docker management tools. I’ve had my eye on Rancher for a while and have been curious about their RancherOS, this is minimal installable OS dedicated to running and managing Docker containers. I don’t have a spare machine free to do a bare metal install, so wondered what it would take to install it in KVM, and whether it would be usable.

The machine I’m installing on is an old HP desktop with an Phenom x4 processor, and only 4GB RAM. The host is running Debian.

Using KVM, I created a new VM with 1 cpu, 1GB, and booted it from the RacherOS ISO:

After booting from the ISO:

Continuing the instructions in the install guide here, I wondered how I would paste in my public ssh key from my host and dev machines, while running this as a guest in KVM. The instructions require you to create a cloud-config.yml and include your ssh public key. After RancherOS is booted, you can use vi to create the file, but pasting into the guest with no guest extensions installed isn’t possible. You can ssh from the vm out to your host to where your key is located, but going in that direction is not much help. What you really need to do is ssh into the guest vm from a host machine, and then you can easily create the cloud-config.xml and paste in your keys.

Trouble is, the whole point of these initial setup steps with installing with the config file including your keys is to enable ssh access to your RancherOS install, so this is bit of a chicken and egg situation. You can’t ssh in remotely because there’s no default user password for the rancher user, and you can’t ssh in with a key, because you haven’t copied it across to the RancherOS install yet.

Searching around, I’m not the only one installing in a VM and encountered this issue. The trick as suggested here, is to reset the rancher user password on first boot (before starting the install), then at least you know what the initial password is (there isn’t a default password apparently, for security reasons, see here). Look up the ip with ifconfig on first boot, reset the password, then you can ssh in from outside, create the cloud-config.yml file, paste in your key(s), and then install per the instructions with:

sudo ros install -c cloud-config.yml -d /dev/sda

After the install had completed, I was able to ssh from outside with my key that I had already added to the cloud-service.yml, and then following through the next section in the docs, listed the available services, all of which were listed as disabled:

Per the docs here, I attempted to start the rancher service, with:

sudo ros service enable rancher-service

and since everything runs on RancherOS is a docker container, it starts to download the image layers:

And then started it up with:

sudo ros service up rancher-service

At this point as was expecting to find rancher running on port 8080, but it was still not up. The docs seem a bit lacking in this area. Googling ‘how to run rancher on rancheros’ gave a few suggestions, but mainly echoing what I’d already done. Running ‘docker ps’ in the guest VM showed me that the container was up and running, and listening on 8080, so tried again in my browser and it seems it just took a few seconds to get started up. I now have Rancher running on RancherOS in a KVM! Now to start checking it out!

 

Downgrading nvidia drivers on Debian 8 to legacy version 304

I have an old HP desktop with onboard nvidia 6150 graphics, and I’ve posted before about installing  the legacy 304 drivers, and installing latest nvidia drivers to support an nvidia 750ti.

I recently moved the 750ti card into my 2008 Mac Pro, so now when booting the HP desktop into Debian with the latest nvidia drivers, Cinnamon crashes, and all I get is a default/low resolution display. So time to go the other way and downgrade back to the legacy 304 drivers (I won’t be moving the 750ti back to this machine).

Taking a gamble that I wouldn’t need to uninstall anything, I followed the steps in this post to install the 304 driver using this command:

aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-legacy-304xx-driver

This gave the error:

The following packages have unmet dependencies:
 nvidia-legacy-304xx-alternative : Depends: glx-alternative-nvidia (< 0.7) but 0.7.3~bpo8+1 is installed.

… accepting the yes option resulted in no changes, so I uninstalled the package it was complaining about:

sudo apt-get remove glx-alternative-nvidia

This removed a number of the previous 375 driver related modules that I had installed for the 750ti card.

Cleaned up anything no longer needed with:

sudo apt-get autoremove

and then rebooted, and success, back to regular 1920×1080 resolution

mysql ‘select … into outfile’ access denied

mysql’s ‘select … into outfile …’ is an easy way to export the results of a query to a file, but to execute this command you need the additional FILE privilege. The privilege is not granted by default, even with ALL, e.g.

grant ALL on exampledb.* to exampleuser;

The ALL privilege does not include FILE, so you’ll see this error:

select * from example into outfile 'test.txt'
ERROR 1045 (28000): Access denied for user 'testuser'@'%' (using password: YES)

To grant the FILE privilege,

grant FILE on *.* to exampleuser;

Note that databasename.* doesn’t appear to work, you have to grant on *.*.