Skip to content

Instantly share code, notes, and snippets.

@tabrez
Last active July 10, 2023 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tabrez/ac7019e67d97ba4f11a9a47be12ffdc7 to your computer and use it in GitHub Desktop.
Save tabrez/ac7019e67d97ba4f11a9a47be12ffdc7 to your computer and use it in GitHub Desktop.

minimal linux box on windows

Install multipass on windows

Help

setup using cloudinit.yaml:

#cloud-config
packages:
  - rename
users:
  - default
  - name: tabrez
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_import_id:
      - gh:tabrez
runcmd:
  - sudo -u tabrez git clone --depth 1 https://gitlab.com/tabrez/minimal-config.git /home/tabrez/minimal-config
  - rm -rf /home/tabrez/minimal-config/.git
  - find /home/tabrez/minimal-config -type f -execdir bash -c 'mv "{}" "/home/tabrez/.$(basename {})"' \;
  - rm -rf /home/tabrez/minimal-config

Run: multipass launch -n min-box --cloud-init cloud-config.yaml

Command for iterating fast: multipass delete --purge min-box && multipass launch --timeout 900 -n min-box --cloud-init cloud-config.yaml && multipass info min-box

Connect as user tabrez: ssh tabrez@ip-address

Copy private ssh key if you want:

multipass transfer C:\Users\iqbal\.ssh\id_rsa min-box:/home/ubuntu/.ssh/id_rsa
# inside min-box as `tabrez` user
# ssh tabrez@ip-address-of-vm (multipass info min-box)
cd ~
sudo cp ../ubuntu/.ssh/id_rsa ./.ssh/
chown tabrez:tabrez ./ssh/id_rsa
chmod 600 ./.ssh/id_rsa

setup using ansible:

  • git clone dominus
  • install docker, docker-compose, k3d, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment