Dropping Multipass for OrbStack
I’ve had it with Multipass, again after upgrading to a newer version of OSX (Tahoe in this instance) Multipass isn’t starting up again with the dreaded “can’t connect to socket” message. I could not resolve it, even restarting daemon and re-installing didn’t resolve the issue. Whilst next to it I had OrbStack running with an X86 ubuntu VM and a local-stack docker image for my Chalice project which was still running as expected.
This made me rethink Multipass, after some thinking and a small experiment I decided to drop Multipass completely and switch all my VM projects over to OrbStack, which was easier then expected as it also supports cloud-init which I was already using for creating VM’s. The only change was needed to my setup scripts in ‘bash’ as the command line for OrbStack is different.
The command line for OrbStack has some peculiarities which I will document here as I had to discover them by trial and error and digging through forums, etc…
Orb will create a user in your VM which is identical to your Mac username. So to use the regular ubuntu user as you main user you have to specify this when you create your VM.
orb create -a $ARCG -c $CLOUDINIT.yaml -u $USERNAME ubuntu:$VERSION $VMNAME
where
- $ARCH is either arm64 (for native Mx) or amd64 (for X86 compatible VM’s)
- $CLOUDINIT is your cloudinit configfile
- $USERNAME is the primary username to be installed on this VM, likely
ubuntu
- $VERSION is the version of Ubunu to install but is optional, if left out the latest version will be installed
- $VMNAME is the name of your VM, will be accessible as $VMNAME.orb.local on your network.
It is not possible to set the amount of CPU, Memory or disk space per VN. You can only set the maximum amount of memory and cpu for the complete OrbStack environment.
Copying files to and from the VM is simple, using orb push
or orb pull
commands:
orb push -m $VMNAME source destination
Executing commands is simple but has some intricacies as where they are executed is not always clearcut, especially if your command is longer and uses piping for instance. You might end up piping the output of a command on your VM to a file on your Mac. For instance: orb -m $VMNAME sudo service mysql restart
is pretty straightforward but:
orb -m $VMNAME mysql -uroot -psecret dbname < /home/ubuntu/projects/outfile.sql'
will let you know that the file isn’t found. To solve this you have to use quotes and the -s option
orb -s -m $VMNAME 'mysql -uroot -psecret dbname < /home/ubuntu/projects/outfile.sql'
Something I havent solved yet is that using cloud-init to set hostname or FQDN does not work yet.
I’m abandoning my multipasssetup project as I won’t be using it anymore. I will create something similar for OrbStack.