V86

From ai-ecoverse/slicc · View interactive version

V86 is an AI agent skill from the GitHub repository ai-ecoverse/slicc. Use this when booting or driving an x86 virtual machine with SLICC's `v86` shell command. Covers the ipk prerequisite, BIOS setup, QEMU-flavored boot flags, and the look-then-act loop (`computer` after `v86 start` registers `v86:<name>`; `v86 type|key|mouse|screenshot|text` remain as aliases).

How to use this skill

Skill file

v86 virtual machines

The v86 shell command boots x86 guests (ISO, raw disk, floppy, or direct Linux kernel) on the v86 wasm engine. Nothing is bundled: install the engine first, then supply BIOS blobs and a guest image as VFS files.

Install prerequisites

ipk add -g v86@0.5.473
mkdir -p /workspace/.v86
curl -o /workspace/.v86/seabios.bin https://raw.githubusercontent.com/copy/v86/master/bios/seabios.bin
curl -o /workspace/.v86/vgabios.bin https://raw.githubusercontent.com/copy/v86/master/bios/vgabios.bin

There is no CDN fallback; missing pieces produce an actionable error with these exact commands.

Boot and lifecycle

v86 start -cdrom alpine.iso              # boot an ISO (prints pid)
v86 start -n dos -fda freedos.img -m 64  # named VM, floppy boot, 64 MiB RAM
v86 start -kernel bzImage -initrd rootfs.img -append "console=ttyS0" -nographic
v86 ls                                   # list running VMs
v86 stop [-n name] [--force]             # power off
v86 state [-n name] save|load <file>     # snapshot / restore full VM state

Arch Linux (copy.sh demo image)

The fastest full-Linux guest is the pre-booted Arch state image from copy.sh (the same one behind https://copy.sh/v86/?profile=archlinux). It resumes straight into a root shell — no BIOS blobs, no boot wait:

curl -o "$TMPDIR/arch_state.bin.zst" https://i.copy.sh/arch_state-v3.bin.zst   # ~15 MB
v86 start -n arch -state "$TMPDIR/arch_state.bin.zst" -fs9p https://i.copy.sh/arch/ -net virtio -m 512
v86 text -n arch                         # should show a root@localhost prompt
v86 type -n arch "uname -a\n"
v86 text -n arch

-state resumes a snapshot (.zst decompresses inside the engine), -fs9p attaches the network-backed 9p root the guest's files live on (fetched on demand, host must send CORS headers), and -net virtio matches the NIC the snapshot was saved with.

Guest networking (fetch relay)

-net <model>,relay=fetch gives the guest outbound HTTP without a gateway: v86's fetch relay answers guest DNS in-engine and turns guest port-80 connections into host fetches, which SLICC reroutes through its CORS-bypassing fetch proxy. Plain-http requests to external hosts are upgraded to https before hitting the proxy (http://localhost stays local).

v86 start -n kolibri -fda kolibri.img -net ne2k,relay=fetch -m 128

Inside the guest, configure a static IP on the relay's subnet (VM 192.168.86.100, router/DNS 192.168.86.1) — e.g. KolibriOS NETCFG or ip addr add in Linux. The guest can then browse http://<host>/...; https-only sites work because of the upgrade rewrite, but the guest itself only ever speaks plain HTTP on port 80.

VMs run in the background as ProcessManager-tracked units — ps shows them and kill <pid> powers them off. Default VM name is vm0; every subcommand accepts -n <name>. RAM defaults to 128 MiB, capped at 512.

Interaction loop

The VM is not an interactive foreground process. v86 start registers v86:<name> as a computer; prefer computer for look-then-act (screenshot-space coords, frozen JPEG frames, chainable xdotool verbs). See /workspace/skills/computer/SKILL.md.

computer use v86:vm0
computer text                   # text-mode dump when the guest is in text mode
computer screenshot             # VGA framebuffer -> JPEG (graphical mode)
computer type "root\n"          # type on the keyboard ('\n' = Enter)
computer key ctrl+alt+Delete enter f2
computer mousemove 20 -5 --relative
computer click 3                # 3 = right

v86 type|key|mouse|screenshot|text remain as thin aliases. computer rm unregisters the computer and does not power the guest off.

v86 serial --send "ls\n"        # write to the guest serial console
v86 serial --tail 25            # read buffered serial output

Prefer computer text / v86 text over screenshot whenever the guest is in text mode — it is cheaper and machine-readable. For -nographic guests use the serial subcommands.

Live screen

v86 serve is retired. Watch a running guest with computer watch:

computer watch -c v86:arch

Live frames go to the Browser overlay, the lightbox, and computer bash rows. v86 serve still exits 0 and prints that pointer so old scripts do not fail.

SVGA / high-res video modes

The guest sees a Bochs-dispi (VBE) SVGA adapter; VESA modes are limited by video memory. The default 8 MiB covers up to 1600x1200x32 — pass -vga <MiB> at boot for more (e.g. -vga 16). Inside a Linux guest, pick a mode with vga= kernel parameters or the guest's own modesetting tools.

Expectations

x86 emulation without KVM runs at a fraction of native speed. Small guests (Alpine, FreeDOS, Buildroot Linux, KolibriOS) work best; give slow boots time and poll with v86 text between steps.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.