Loading...
Loading...
Patterns for OrbStack Linux VMs and Docker on macOS. Covers orbctl/orb commands, machine lifecycle, cloud-init, networking, file sharing, and SSH access. Must use when working with OrbStack, orbctl commands, or Linux VMs on macOS.
npx skill4agent add 0xbigboss/claude-code orbstack-best-practices# Start/stop
orb # Start + open default machine shell
orb start # Start OrbStack
orb stop # Stop OrbStack
# Machine management
orb list # List machines
orb create ubuntu # Create with latest version
orb create ubuntu:jammy myvm # Specific version + name
orb create --arch amd64 ubuntu intel # x86 on Apple Silicon
orb delete myvm # Delete machine
# Shell access
orb # Default machine shell
orb -m myvm # Specific machine
orb -u root # As root
orb -m myvm -u root # Combined
# Run commands
orb uname -a # Run in default machine
orb -m myvm ./script.sh # Run in specific machine
# File transfer
orb push ~/local.txt # Copy to Linux
orb pull ~/remote.txt # Copy from Linux
orb push -m vm ~/f.txt /dest/ # Push to specific machine/path
# Docker/K8s
orb restart docker # Restart Docker engine
orb logs docker # Docker engine logs
orb start k8s # Start Kubernetes
orb delete k8s # Delete K8s cluster
# Config
orb config set memory_mib 8192 # Set memory limit
orb config docker # Edit daemon.json| Path | Description |
|---|---|
| Linux files from macOS |
| Docker volumes from macOS |
| macOS files from Linux |
| Other machines from Linux |
| SSH private key |
| Docker daemon config |
| Pattern | Description |
|---|---|
| Linux machine |
| Docker container |
| Compose service |
| macOS from Linux machine |
| macOS from container |
| Docker from Linux machine |
orb create ubuntu # Latest Ubuntu
orb create ubuntu:noble devbox # Ubuntu 24.04 named "devbox"
orb create --arch amd64 debian x86vm # x86 emulation via Rosetta
orb create --set-password ubuntu pwvm # With password set
orb create ubuntu myvm -c cloud.yml # With cloud-initorb start myvm # Start stopped machine
orb stop myvm # Stop machine
orb restart myvm # Restart
orb delete myvm # Delete permanently
orb default myvm # Set as default machine
orb logs myvm # View boot logsorb create ubuntu myvm -c user-data.ymluser-data.yml#cloud-config
packages:
- git
- vim
- docker.io
users:
- name: dev
groups: sudo, docker
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
runcmd:
- systemctl enable docker
- systemctl start dockerorb logs myvm # Boot logs from macOS
orb -m myvm cloud-init status --long # Status inside machine
orb -m myvm cat /var/log/cloud-init-output.loglocalhost# In Linux: python3 -m http.server 8000
# From macOS: curl localhost:8000 or curl myvm.orb.local:8000# From Linux machine
curl host.orb.internal:3000
# From Docker container
curl host.docker.internal:3000orb config set network_proxy http://proxy:8080orb config set network_proxy none# Same paths work
cat /Users/allen/file.txt
cat /mnt/mac/Users/allen/file.txt # Explicit prefixls ~/OrbStack/myvm/home/user/
ls ~/OrbStack/docker/volumes/myvolume/orb push ~/local.txt # To default machine home
orb pull ~/remote.txt # From default machine
orb push -m vm ~/f.txt /tmp/ # To specific pathssh orb # Default machine
ssh myvm@orb # Specific machine
ssh user@myvm@orb # Specific user + machineorbmyvm@orblocalhost32222~/.orbstack/ssh/id_ed25519[servers]
myvm@orb ansible_user=ubuntudocker run --name web nginx
# Access: http://web.orb.local (no port needed for web servers)
# Compose: <service>.<project>.orb.local.orb.localcurl https://mycontainer.orb.localdocker run -l dev.orbstack.domains=myapp.local nginxdocker run --net=host nginx
# localhost works both directionsdocker run --platform linux/amd64 ubuntu
export DOCKER_DEFAULT_PLATFORM=linux/amd64 # Default to x86docker run -v /run/host-services/ssh-auth.sock:/agent.sock \
-e SSH_AUTH_SOCK=/agent.sock alpinedocker run -v mydata:/data alpine # Volume (fast)
docker run -v ~/code:/code alpine # Bind mount (slower)orb start k8s # Start cluster
kubectl get nodes # kubectl includedcurl myservice.default.svc.cluster.local # cluster.local works
curl 192.168.194.20 # Pod IPs work
curl myservice.k8s.orb.local # LoadBalancer wildcardlatestimagePullPolicy: IfNotPresentorb report # Generate diagnostic report
orb logs myvm # Machine boot logs
orb logs docker # Docker engine logs
orb restart docker # Restart Docker
orb reset # Factory reset (deletes everything)orb startdocker context use orbstackorb logs myvmorb restart myvmsudo dpkg --add-architecture amd64
sudo apt update && sudo apt install libc6:amd64orb config set rosetta true # Enable x86 emulation
orb config set memory_mib 8192 # Memory limit (MiB)
orb config set cpu 4 # CPU limit (cores)
orb config set network_proxy auto # Proxy (auto/none/url)~/.orbstack/config/docker.json{
"insecure-registries": ["registry.local:5000"],
"registry-mirrors": ["https://mirror.gcr.io"]
}orb restart dockermac open https://example.com # Open URL in macOS browser
mac uname -a # Run macOS command
mac link brew # Link command for reuse
mac notify "Build done" # Send notificationORBENV=AWS_PROFILE:EDITOR orb ./deploy.sh