All Projects → gyf304 → Vmcli

gyf304 / Vmcli

Licence: bsd-2-clause
A set of utilities (vmcli + vmctl) for macOS Virtualization.framework

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Vmcli

vm-automation
VirtualBox automation using Python
Stars: ✭ 1 (-99.82%)
Mutual labels:  vm, virtual-machine
RISVM
A low overhead, embeddable bytecode virtual machine in C++
Stars: ✭ 21 (-96.32%)
Mutual labels:  vm, virtual-machine
tsharkVM
tshark + ELK analytics virtual machine
Stars: ✭ 51 (-91.07%)
Mutual labels:  vm, virtual-machine
RSqueak
A Squeak/Smalltalk VM written in RPython.
Stars: ✭ 78 (-86.34%)
Mutual labels:  vm, virtual-machine
Vultr
🐧 Vultr CLI and API client library
Stars: ✭ 357 (-37.48%)
Mutual labels:  cli, virtual-machine
Animach
Scheme语言实现和运行时环境 / A Scheme runtime & implementation
Stars: ✭ 45 (-92.12%)
Mutual labels:  vm, virtual-machine
open-semantic-desktop-search
Virtual Machine for Desktop Search with Open Semantic Search
Stars: ✭ 22 (-96.15%)
Mutual labels:  vm, virtual-machine
specter
a (tiny) VM project built with Go
Stars: ✭ 57 (-90.02%)
Mutual labels:  vm, virtual-machine
Ark
ArkScript is a small, fast, functional and scripting language for C++ projects
Stars: ✭ 312 (-45.36%)
Mutual labels:  virtual-machine, vm
Virtualbox Python
Complete implementation of VirtualBox's COM API with a Pythonic interface.
Stars: ✭ 277 (-51.49%)
Mutual labels:  virtual-machine, vm
SBTCVM-Gen2-9
SBTCVM is a virtual machine implementation of a balanced ternary (base 3) computer. Features several compiled languages for ternary software development.
Stars: ✭ 32 (-94.4%)
Mutual labels:  vm, virtual-machine
Embiggen Disk
embiggden-disk live-resizes a filesystem after first live-resizing any necessary layers below it: an optional LVM LV and PV, and an MBR or GPT partition table
Stars: ✭ 440 (-22.94%)
Mutual labels:  virtual-machine, vm
butterfly
Butterfly connects Virtual Machines and control their traffic flow
Stars: ✭ 48 (-91.59%)
Mutual labels:  vm, virtual-machine
kcs
Scripting in C with JIT(x64)/VM.
Stars: ✭ 25 (-95.62%)
Mutual labels:  vm, virtual-machine
c8c
The chip8 compiler, assembler, and virtual machine
Stars: ✭ 110 (-80.74%)
Mutual labels:  vm, virtual-machine
js5005
js5005 is a virtual CPU with every logic gate simulated. A pretty interface, a built in assembler, display, and 256 bytes of RAM to boot. It's the better i4004.
Stars: ✭ 14 (-97.55%)
Mutual labels:  vm, virtual-machine
clox
A virtual machine and a tree-walk interpreter for the Lox programming language in C89 🌀
Stars: ✭ 38 (-93.35%)
Mutual labels:  vm, virtual-machine
Tagha
Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
Stars: ✭ 101 (-82.31%)
Mutual labels:  vm, virtual-machine
Smlvm
Smallrepo Virtual Machine
Stars: ✭ 265 (-53.59%)
Mutual labels:  virtual-machine, vm
16bitjs
💻 A 16-bit virtual machine, including assembly language with 37 instructions, binary assembler, and a step through debugger
Stars: ✭ 427 (-25.22%)
Mutual labels:  virtual-machine, vm

VMCLI

A set of utilities to help you manage VMs with Virtualization.framework

vmctl-demo

Installation

Prerequisites

  • macOS Big Sur (11+)
  • XCode.app installed
# make sure xcode command-line tools are installed
xcode-select --install

# run build, install. This will install vmcli and vmctl to /usr/local/bin
make
sudo make install

You have now finished installing vmcli and vmctl

Set environment variable VMCTLDIR to ~/VMs so vmctl knows how to find VMs. If you don't set this, vmctl will use current working directory to find VMs.

echo 'export VMCTLDIR="$HOME/VMs"' >> ~/.zprofile
export VMCTLDIR="$HOME/VMs"

Provision a Ubuntu VM, and install that to ~/VMs. The VM will auto create your user with your ssh public key at ~/.ssh/id_rsa.pub.

make build/vm/ubuntu
mv build/vm/ubuntu "${VMCTLDIR}/ubuntu"

Optionally expand the VM volume, for example to 16G.

dd if=/dev/null of="${VMCTLDIR}/ubuntu/disk.img" bs=1g count=0 seek=16

Optionally edit the VM config for more RAM and/or CPU cores

vi "${VMCTLDIR}/ubuntu/vm.conf"

Start the VM

vmctl start ubuntu

Attach to the serial console, use (CTRL+A - D to quit)

vmctl attach ubuntu

You can use vmctl ip ubuntu to check your VM IP.

Wait for the VM to boot and ssh into the VM

vmctl ssh ubuntu

You should shutdown the VM using ssh within the VM. If that's not an option, you can forcibly shut it down.

vmctl stop ubuntu

Known Issues

  • Virtual Machine cannot be started with networking when InternetSharing is already enabled. See #3.

Usage

vmcli

USAGE: vmcli [--cpu-count <cpu-count>] [--memory-size <memory-size>] [--memory-size-suffix <memory-size-suffix>] [--disk <disk> ...] [--cdrom <cdrom> ...] [--network <network> ...] [--balloon <balloon>] [--bootloader <bootloader>] [--kernel <kernel>] [--initrd <initrd>] [--cmdline <cmdline>] [--escape-sequence <escape-sequence>]

OPTIONS:
  -c, --cpu-count <cpu-count>
                          CPU count (default: 1)
  -m, --memory-size <memory-size>
                          Memory Bytes (default: 512)
  --memory-size-suffix <memory-size-suffix>
                          Memory Size Suffix (default: MiB)
  -d, --disk <disk>       Disks to use 
  --cdrom <cdrom>         CD-ROMs to use 
  -n, --network <network> Networks to use. e.g. aa:bb:cc:dd:ee:[email protected] for a nat device, or [email protected] for bridging to en0. Omit mac address for a
                          generated address. (default: nat)
  --balloon <balloon>     Enable / Disable Memory Ballooning (default: true)
  -b, --bootloader <bootloader>
                          Bootloader to use (default: linux)
  -k, --kernel <kernel>   Kernel to use 
  --initrd <initrd>       Initrd to use 
  --cmdline <cmdline>     Kernel cmdline to use 
  --escape-sequence <escape-sequence>
                          Escape Sequence, when using a tty (default: q)
  -h, --help              Show help information.

vmctl

usage: vmctl {start|stop|attach|ip|ssh} vm
       vmctl list

References

SimpleVM is a proof-of-concept using Virtualization.framework by KhaosT

vftool is a very similar tool written by evansm7 but in Objective-C not Swift.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].