genutm
Project description
genutm
genutm creates aarch64 linux VMs that run via Apple Virtualization Framework
utilizing UTM bundles, alongside the CIDATA cloud-init ISOs that hold the
user-data and meta-data YAMLs.
installation and usage
docker is necessary to call qemu-imq without having to install the full qemu
suite via brew. picocom is for providing serial console access when the user
doesn't enable ssh key access for a user they create.
# pull deps
brew install docker utm --cask
brew install picocom
# install release
pip install genutm
# pull latest debian 12 qcow2
curl -L \
https://cdimage.debian.org/images/cloud/bookworm/latest/debian-12-generic-arm64.qcow2 \
-o $HOME/debian-12-generic-arm64.qcow2
# create userspec
genutm mkuser
# create vmspec
cat << EOF > vm.yml
---
vmspec:
dom_name: debian12arm1
dom_mem: 2048
dom_vcpu: 2
vol_size: 10
base_image: $HOME/debian-12-generic-arm64.qcow2
sshpwauth: yes
EOF
# create arbitrary user-data additions (optional)
cat << EOF > userdata.yml
package_update: true
package_upgrade: true
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg
write_files:
- path: /tmp/hello.txt
content: |
hello world!
runcmd:
- systemctl mask iptables
- systemctl enable --now nftables
EOF
# create cidata.iso and utm bundle
gencloud create vm.yml --users userspec-*.yml --userdata userdata.yml
# register and start vm
open debian12arm1.utm
# hook up to serial
picocom /dev/ttys006
configuration
specification
domains
| key | necessity | description |
|---|---|---|
| dom_name | required | str name of the domain |
| dom_mem | required | int amount of memory in megabytes |
| dom_vcpu | required | int core count |
| vol_size | required | int disk size in gigabytes |
| base_image | required | str full path to the cloud-init capable cloud image[1] |
| sshpwauth | optional | bool whether to allow ssh authentication via passwords (VM-wide, applies to all users) |
users
| key | necessity | description |
|---|---|---|
| name | required | str name of the user |
| password_hash | optional | str password hash in shadow compliant crypt() format (like mkuser output) |
| ssh_keys | optional | list of str list of ssh keys to append to the authorized_keys of the user |
| sudo_god_mode | required | bool toggle for adding the user to the sudo group and allowing it to run sudo without a password |
WARNING: if you do not specify any authentication method in the file
supplied via --users and if you:
- do not specify an arbitrary
user-datafile via--userdata, - or, specify a
user-databut the resulting finalcloud-inituser-datayaml to be written to the iso ends up having no valid authentication method
program will halt.
examples
--users <userspec.yml>
you can also do genutm mkuser to interactively generate a userspec.yml
through prompts.
---
userspec:
- name: john
password_hash: '$y$j9T$/gPg8H0fdtuZh8Ja8decf.$f7IzP89gNaToHUsY2bdgaxv2HJsKSRYLyG6mxNZ6AW3'
sudo_god_mode: true
- name: doe
ssh_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI0000000000000000000000000000000000000000000
<vmspec.yml>
---
vmspec:
dom_name: testvm
dom_mem: 2048
dom_vcpu: 2
net: cloudvirt
vol_size: 10
base_image: /Users/user/debian-12-generic-arm64.qcow2
sshpwauth: true
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genutm-0.2.1.tar.gz.
File metadata
- Download URL: genutm-0.2.1.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cfc80add0a5ca5e622761d8714b180465828cb3c103880b02e8b7dea4e5ab4d
|
|
| MD5 |
cb0380f5aef75f2af6e62051b33fdd58
|
|
| BLAKE2b-256 |
305fd875777f95f309a06bbb87b4047b8f0cae8b83a8e0b69d1a245761fdc94e
|
Provenance
The following attestation bundles were made for genutm-0.2.1.tar.gz:
Publisher:
pypi.yml on gottaeat/genutm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genutm-0.2.1.tar.gz -
Subject digest:
2cfc80add0a5ca5e622761d8714b180465828cb3c103880b02e8b7dea4e5ab4d - Sigstore transparency entry: 254021352
- Sigstore integration time:
-
Permalink:
gottaeat/genutm@79ace2e24a2de086e205ea9197783c84ed2d55ab -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/gottaeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@79ace2e24a2de086e205ea9197783c84ed2d55ab -
Trigger Event:
release
-
Statement type:
File details
Details for the file genutm-0.2.1-py2.py3-none-any.whl.
File metadata
- Download URL: genutm-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55db37dc658287d30b05d007e018e668b4fc343e44449982893e896534b11471
|
|
| MD5 |
ef224b5f5f1b69acc793eb1434a22a48
|
|
| BLAKE2b-256 |
22980f1ce3520724649681cf6b261aac29f88b0554ff138a81f016207d7046e3
|
Provenance
The following attestation bundles were made for genutm-0.2.1-py2.py3-none-any.whl:
Publisher:
pypi.yml on gottaeat/genutm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genutm-0.2.1-py2.py3-none-any.whl -
Subject digest:
55db37dc658287d30b05d007e018e668b4fc343e44449982893e896534b11471 - Sigstore transparency entry: 254021366
- Sigstore integration time:
-
Permalink:
gottaeat/genutm@79ace2e24a2de086e205ea9197783c84ed2d55ab -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/gottaeat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@79ace2e24a2de086e205ea9197783c84ed2d55ab -
Trigger Event:
release
-
Statement type: