SmartOS/live 378eeaa — nix nixpkgs-illumos.json

nix: pin nixpkgs-illumos c3d503e: an image of the proto area takes its SMF, man and boot files from it

Images made by tools/src_workspace image and tools/illumos_workspace
image took their SMF repository, whatis databases and loader files from
the Nix build rather than from proto, and had the Nix build's stages
built again for a checkout with changes; now they are made from proto,
and the stages are not built.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+3-3nix/nixpkgs-illumos.json
+3-31 files

SmartOS/live 28d10e1 — . README.md, nix nixpkgs-illumos.json

nix: build src incrementally with tools/src_workspace

tools/src_workspace proto|build|image builds this checkout's src and man
in place, as gmake world does, into proto (filled first with illumos and
illumos-extra's packages, as 0-extra-stamp installs them), with the Nix
build's strap, compiler and tools (nixpkgs-illumos'
smartos-live.srcWorkspace), and makes a platform with that whole proto
area (build_nix --proto). tools/illumos_workspace image takes the whole
area too once src_workspace has filled it. The pin moves to
nixpkgs-illumos d5ac4bc, which has them.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+30-0tools/src_workspace
+10-0README.md
+7-2tools/illumos_workspace
+3-3nix/nixpkgs-illumos.json
+50-54 files

SmartOS/live 695f16c — nix nixpkgs-illumos.json

nix: pin nixpkgs-illumos 6bc6504: boot-vm's log beside the image, the summary names the checkout

boot-vm wrote its console log in the current directory, in a checkout an
untracked file the next build refuses; the build's summary now says
which checkout its clean or dirty is of; and smartos.nix is callable
from nix-build as it is.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+3-3nix/nixpkgs-illumos.json
+3-31 files

SmartOS/live 5515940 — . README.md, nix nixpkgs-illumos.json

nix: build illumos-joyent incrementally with tools/illumos_workspace

tools/illumos_workspace [-d DIR] env|bldenv [COMMAND]|nightly|image runs
the illumos nightly in a checkout (projects/illumos by default), as
gmake world does, with the Nix build's compiler and tools in place of
pkgsrc and the strap cache (nixpkgs-illumos' smartos-illumos.workspace),
rebuilds a directory with dmake under bldenv, and makes a platform with
what the checkout built (build_nix --illumos-proto): quick, stamped as
dirty, not a Nix output. The pin moves to nixpkgs-illumos ffffa44, which
has them.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+43-0tools/illumos_workspace
+17-2README.md
+3-3nix/nixpkgs-illumos.json
+63-53 files

SmartOS/live c8296e7 — . README.md

README: running a Nix build wider than one package at a time

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+10-0README.md
+10-01 files

SmartOS/live 663fe96 — . default.nix README.md, nix nixpkgs-illumos.json

nix: build an illumos-joyent checkout with tools/build_nix --illumos DIR

default.nix takes illumos, a checkout of illumos-joyent built in place
of the pinned commit (nixpkgs-illumos acfdc7e); tools/build_nix gives it
with --illumos DIR, through build-smartos --arg (c6f886d, now pinned).

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+17-5tools/build_nix
+7-0README.md
+3-3nix/nixpkgs-illumos.json
+6-0default.nix
+33-84 files

SmartOS/live d54dbfe — . default.nix, nix nixpkgs-illumos.json

nix: the platform names the nixpkgs-illumos commit it was built with

The pin moves to nixpkgs-illumos 432283b and records the commit's date;
default.nix gives the pin to the build when it fetched the recipes at
it, so gitstatus.json names that commit. A checkout of nixpkgs-illumos
standing in (NIX_PATH, -I or --arg nixpkgsIllumos) is named by its own.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+31-8default.nix
+3-2nix/nixpkgs-illumos.json
+34-102 files

SmartOS/live 4031bc9 — . README.md

README: building with Nix

How to go from a SmartOS host to a platform: the nix-zone image, a
builder-brand zone from it, and tools/build_nix.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+63-0README.md
+63-01 files

SmartOS/live a39cc3e — . default.nix, nix nixpkgs-illumos.json

Build SmartOS with Nix from this checkout

default.nix is the package set of nixpkgs-illumos' SmartOS build, at the
commit nix/nixpkgs-illumos.json pins, with this checkout as the
smartos-live built and the identity the build is stamped from.
tools/build_nix makes a platform and its USB image in one step, through
nixpkgs-illumos' build-smartos.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+29-0default.nix
+13-0tools/build_nix
+6-0nix/nixpkgs-illumos.json
+48-03 files

SmartOS/live 72461a5 — src/vm/man vmadm.8.md, src/vm/node_modules docker-logconfig.js

vmadm: apply stored max-size when enabling json-file logging
DeltaFile
+22-0src/vm/tests/test-docker-logconfig.js
+10-4src/vm/node_modules/docker-logconfig.js
+3-1src/vm/man/vmadm.8.md
+35-53 files

SmartOS/live 4b3897a — src/lib/sdc config.sh, src/vm/man vmadm.8.md

Merge branch 'master' into zlog-keep-rotated
DeltaFile
+9-6src/vm/man/vmadm.8.md
+3-4src/lib/sdc/config.sh
+12-102 files

SmartOS/live 0f5d3d2 — src/vm/man vmadm.8.md, src/vm/node_modules VM.js docker-logconfig.js

OS-8787: keep Docker log retention bounded on updates
DeltaFile
+159-15src/vm/tests/test-docker-logconfig.js
+109-7src/vm/tests/test-docker.js
+68-27src/vm/node_modules/docker-logconfig.js
+46-39src/vm/node_modules/VM.js
+28-16src/vm/man/vmadm.8.md
+410-1045 files

SmartOS/live 56b5d50 — src/vm/man vmadm.8.md, src/vm/node_modules docker-logconfig.js VM.js

smartos-live#1187 vmadm: harden docker:logconfig zlog derivation

Fixes from review of the previous two commits:

- A docker:logconfig, payload or vmobj with its own 'hasOwnProperty'
  key no longer throws during create or update.
- Derive zlog_max_size and zlog_keep_rotated in normalizePayload(), so
  they are validated, written by setAttr() and waited for in VM.update
  like explicit properties. This removes the separate zonecfg path, the
  second parse per update, and the docker:true + logconfig update that
  returned before vminfod reported the change. The logic now lives in
  docker-logconfig.js (zlogPropsForPayload).
- An update that sets docker:logconfig without an option, or removes
  docker:logconfig, removes the derived property. Invalid options still
  leave it unchanged.
- Updating zlog_keep_rotated or zlog_max_size to 0 on a VM without the
  property is a no-op instead of waiting for vminfod until timeout.
- vmadm(8): vmtype is OS for both properties, and document the clearing
  rules and max-file=1.

    [2 lines not shown]
DeltaFile
+31-117src/vm/node_modules/VM.js
+140-4src/vm/tests/test-docker-logconfig.js
+105-18src/vm/node_modules/docker-logconfig.js
+34-1src/vm/tests/test-docker.js
+11-7src/vm/man/vmadm.8.md
+321-1475 files

SmartOS/live 226d044 — src Makefile, src/vm/man vmadm.8.md

smartos-live#1187 vmadm: set zlog attrs from docker:logconfig

When a create or update payload sets internal_metadata
'docker:logconfig' on a docker VM using the json-file log driver, set
zlog_max_size from its max-size option and zlog_keep_rotated from its
max-file option (max-file - 1, between 1 and 1000). A zlog_max_size or
zlog_keep_rotated property in the same payload takes precedence.
Invalid options are logged and ignored. VM.update waits for vminfod to
report the derived properties.

Add docker-logconfig.js with the option parsing, unit tests in
test-docker-logconfig.js, integration tests in test-docker.js, and
document the behaviour in vmadm(8).

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+194-0src/vm/tests/test-docker-logconfig.js
+162-0src/vm/node_modules/docker-logconfig.js
+126-0src/vm/tests/test-docker.js
+116-2src/vm/node_modules/VM.js
+14-0src/vm/man/vmadm.8.md
+2-0src/Makefile
+614-21 files not shown
+615-27 files

SmartOS/live e43a226 — src/vm/man vmadm.8.md, src/vm/node_modules VM.js proptable.js

smartos-live#1187 vmadm: add zlog_keep_rotated property

Add a zlog_keep_rotated property that maps to the zlog-keep-rotated
zone attribute, which zoneadmd(8) uses to limit the number of rotated
stdio.log files kept for docker zones. Accepts integers 0-1000 on
create, receive and update; 0 removes the attribute. Document it in
vmadm(8) and add create/update/validation tests to test-docker.js.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+82-0src/vm/tests/test-docker.js
+15-0src/vm/man/vmadm.8.md
+14-0src/vm/node_modules/proptable.js
+1-0src/vm/node_modules/VM.js
+112-04 files

SmartOS/live 660a14c —

Merge previous rfd-0189-console-access history

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_019GjJri3QtFN4DpaQhSo4ZE
DeltaFile
+0-00 files

SmartOS/live 6ac3aa2 — src/vm/node_modules console_broker.js, src/vm/tests test-console-broker.js

Destroy console connections after an ERR reply

A client that never closed its end could keep rejected connections open
without counting against the pending limit.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_019GjJri3QtFN4DpaQhSo4ZE
DeltaFile
+32-0src/vm/tests/test-console-broker.js
+16-3src/vm/node_modules/console_broker.js
+48-32 files

SmartOS/live 36ad05e — src/vm/sbin vmadmd.js

update comments for Zoneadmd Console Handshake Protocol
DeltaFile
+18-1src/vm/sbin/vmadmd.js
+18-11 files

SmartOS/live fee85e2 — src/vm/man vmadmd.8.md, src/vm/node_modules console_broker.js

Bound console tickets and session lifetime

Stop the listener once no tickets remain, even with unauthenticated
connections open, cap outstanding tickets, and end sessions after 8 hours.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_019GjJri3QtFN4DpaQhSo4ZE
DeltaFile
+55-1src/vm/tests/test-console-broker.js
+27-6src/vm/node_modules/console_broker.js
+2-2src/vm/man/vmadmd.8.md
+84-93 files

SmartOS/live d97f549 — src/vm/man vmadm.8.md vmadmd.8.md, src/vm/node_modules proptable.js

Replace always-on console proxy with ticketed sessions

vmadm info <uuid> console now issues a single-use ticket instead of
reporting a permanent unauthenticated listener. Tickets and sessions are
revoked for all brands when a VM leaves running.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_019GjJri3QtFN4DpaQhSo4ZE
DeltaFile
+57-237src/vm/sbin/vmadmd.js
+26-0src/vm/man/vmadmd.8.md
+12-7src/vm/man/vmadm.8.md
+4-4src/vm/node_modules/proptable.js
+99-2484 files

SmartOS/live feb91e5 — src manifest Makefile, src/vm/node_modules console_broker.js

Add ticketed console broker for remote console access

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_019GjJri3QtFN4DpaQhSo4ZE
DeltaFile
+593-0src/vm/node_modules/console_broker.js
+475-0src/vm/tests/test-console-broker.js
+2-0src/Makefile
+1-0src/manifest
+1,071-04 files

SmartOS/live 22b0eef — src/vm/sbin vmadmd.js

Add named constants and improve protocol validation

- Add CONSOLE_HANDSHAKE_TIMEOUT (5000ms) and CONSOLE_LOG_TRUNCATE_LEN (100)
  named constants to replace magic numbers
- Use stricter protocol validation: data.toString().trim() === 'OK'
  instead of indexOf('OK') === 0 for more robust handshake checking

The stricter validation prevents false positives if the response contains
"OK" as a substring of a different message.

Addresses PR review feedback from https://github.com/TritonDataCenter/smartos-live/pull/1159

Co-Authored-By: Claude Opus 4.5 <noreply at anthropic.com>
DeltaFile
+7-3src/vm/sbin/vmadmd.js
+7-31 files

SmartOS/live 9bb17cd — src/vm/sbin vmadmd.js

Fix resource leaks and add handshake timeout in console proxy

Critical fixes for console connection handler:

1. Replace deprecated net.Stream() with new net.Socket()
2. Add cleanup() function with idempotent guard to prevent double-cleanup
3. Add 5-second timeout for zone console handshake
4. Ensure socket.destroy() called on all error paths:
   - Client close
   - Console socket error
   - Client error
   - Handshake timeout
   - Handshake failure
5. Rename 'console' variable to 'consoleSocket' to avoid shadowing global
6. Truncate handshake error messages to prevent log spam

These fixes prevent file descriptor leaks and hanging connections that
could exhaust system resources under error conditions.


    [3 lines not shown]
DeltaFile
+51-14src/vm/sbin/vmadmd.js
+51-141 files

SmartOS/live c34cc8c — src/vm/sbin vmadmd.js

Use zoneadmd console socket instead of /dev/zcons device

The correct console socket for zlogin -C is managed by zoneadmd at
/var/run/zones/<zonename>.console_sock, not the /dev/zcons device.

All brands now use unix sockets:
- KVM: /zones/<uuid>/root/tmp/vm.console (serial console)
- Others: /var/run/zones/<zonename>.console_sock (zoneadmd console)

This allows simple net.Stream() connection for all brands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+15-59src/vm/sbin/vmadmd.js
+15-591 files

SmartOS/live 6eea141 — src/vm/sbin vmadmd.js

Fix console proxy to use fs streams for device files

Zone console devices (/dev/zcons/*/zoneconsole) are character devices,
not unix sockets. net.connect() fails with ENOTSOCK when trying to
connect to them.

Fix by using different connection methods based on brand:
- KVM: net.Stream().connect() for unix socket
- Others: fs.createReadStream/WriteStream for device file

This allows proper bidirectional data flow for zone console devices.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+43-11src/vm/sbin/vmadmd.js
+43-111 files

SmartOS/live 07e2e36 — src/vm/sbin vmadmd.js

Spawn console proxy for all running VMs at startup

Fix issue where non-KVM/Bhyve VMs (Joyent, LX) were not getting console
proxies spawned at vmadmd startup. Previously only KVM/Bhyve called loadVM()
which spawned the console proxy.

Now all running VMs get console proxies regardless of brand.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+4-0src/vm/sbin/vmadmd.js
+4-01 files

SmartOS/live 23716b5 — src/vm/sbin vmadmd.js

Add console proxy support to vmadmd

Implement TCP proxy for console access across all VM brands:
- KVM: Proxy to unix socket at /tmp/vm.console (serial console)
- Bhyve/Joyent/LX: Proxy to zone console device at /dev/zcons/<zonename>/zoneconsole

Changes:
- Add CONSOLE object to track console proxy state
- Add spawnConsoleProxy() to create TCP listeners for console access
- Add clearConsoleProxy() and reloadConsoleProxy() for lifecycle management
- Add infoConsole() to return console connection details via vm.info()
- Add console proxy spawning alongside VNC/SPICE in VM lifecycle
- Add vm.info() support for joyent, joyent-minimal, and lx brands (console only)

Console proxies are automatically created when VMs start and cleaned up when VMs stop.
Connection details (host, port, type) are available via vm.info(['console']).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+154-0src/vm/sbin/vmadmd.js
+154-01 files

SmartOS/live 02fee4a — src/vm/sbin vmadmd.js

Use socat to proxy zone console devices

fs.createReadStream doesn't work properly with character devices like
/dev/zcons/*/zoneconsole. Use socat instead to handle the device I/O
properly.

For non-KVM brands, spawn socat process per connection to proxy between
TCP socket and zone console device with proper raw/echo settings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+22-10src/vm/sbin/vmadmd.js
+22-101 files

SmartOS/live 60437de — src/vm/node_modules proptable.js

Add console to runtime_info for all VM brands

Add 'console' to runtime_info feature list for all brands to enable
vmadm info queries for console connection details.

Changes:
- KVM: Add 'console' to existing runtime_info array
- Bhyve: Add 'console' to runtime_info array
- Joyent: Add runtime_info: ['console'] (new)
- Joyent-minimal: Add runtime_info: ['console'] (new)
- LX: Add runtime_info: ['console'] (new)

This allows vm.info(['console']) to work for all brands, which is
required by CNAPI console endpoint and vmadmd console proxy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+6-3src/vm/node_modules/proptable.js
+6-31 files

SmartOS/live 80508ea — src/vm/sbin vmadmd.js

Add zoneadmd console handshake for non-KVM brands

The zoneadmd console_sock requires a protocol handshake before data flows.
Send 'IDENT C 0\n' and wait for 'OK' response before proxying data.

This matches the zlogin -C handshake protocol.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+28-3src/vm/sbin/vmadmd.js
+28-31 files