...
Otherwise, Microsoft’s annual upgrade (from say 21H2 to 22H2) screws up )for you.
Your Multipass VMs are real Hyper-V VMs. You can run them from Hyper-V, login to them with a Hyper-V console window, and generally ignore Multipass if you want.
However, the special services provided by the multipass command only work fail if the Multipass directories don’t get clobbered where the ssh key is deleted or overwritten with a new key.
Until Version 1.9 Multipass stored its files in a directory that Microsoft believed it could delete on any annual major version upgrade of Windows 10 or 11. Even if that is fixed, you are given an opportunity to delete everything whenever in the middle of the Setup dialogs each time Multipass updates its software . It is just too easy to screw upwith new fixes. Hit the Yes button instead of the No button and it is all gone.
So you should always create Multipass VMs that can stand on their own without a multipass command. You should also take advantage of Hyper-V tools to checkpoint and backup and export VMs. You should also find and backup the multipass ssh keys.
If you upgrade to 22H2 and Multipass appears to have been deleted, remember that the old files are saved for a month or so in the C:\Windows.old directory. That does not, however, give you instructions for restoring your old multipass installation on the new system.
On each VM, do a “sudo passwd ubuntu” and give the built in ubuntu user a real password and not just SSH keys.
Add a second user with your own normal SSH login key and a password, and give it SUDO privileges.
Find the Multipass ssh key and save the file separately (it has no passcode).
...
In theory there is a manual at https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html . However, it just barely explains what to do and is maybe not more comprehensive than copying the example above.
Add
...
DHCP or a Router to Sandbox
Start with either a one or two machine isolated Sandbox network. Now create a new VM and install on it some firewall, gateway, or router service. You can, for example, search for “pfSense”, “opnSense”, or “openWRT” as examples (I personally have been using pfSense for many years).
You attach this one VM to the Sandbox and to some External network adapter. This now provides a connection to other networks that does not go through a Host computer and is not limited to the functions provided by Default. Just exactly how many functions you want to provide (DHCP, DNS, VPN, firewall, ad blocking, reverse proxy, etc.) is up to you. You probably want to change the static IP addresses back to DHCP and then configure the same addresses in the DHCP configuration panel of the firewallObviously, if you just want DHCP in the Sandbox, install it on one of the Multipass VMs you create. By itself this is of limited use because it is easier to configure static IP on the VM than it is to update the DHCP configuration with a new Ethernet MAC address and an IP address.
You get more if you add a service that combines DHCP, DNS, a firewall, and a gateway to the Sandbox network. For this, you create an empty VM and install a system from a DVD image. Search for “pfSense”, “opnSense”, or “openWRT” for widely used alternatives. These systems are not related to Multipass, so I just suggest them as network configuration options.
There is also a physical version of this, where you attach a firewall/gateway box to a physical switch into which you plug the two adapters used in take the Ethernet adapters connecting a Sandbox 2 configuration . This puts and plug them into the wired ports on the back of a TPLink or Netgate device into your Internal Sandbox network. This is simpler if you know how to configure such a device and don’t want to learn how to run wired router/gateway box. Then you only have to know how to admin these familiar boxes and you don’t need to learn pfSense.
Make the Second Adapter Preferred
...