본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)6.9k · #13717

dev-env

하는 일

중지했다가 다시 시작해도 설치한 도구가 남아 있는 smolvm 가상 머신을 설정합니다. 프로젝트에 돌아올 때마다 같은 작업 환경을 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓작업 세션 사이에도 같은 상태를 유지해야 하는 개발 환경이 프로젝트에 필요할 때.
  • ✓재시작 후 머신에서 설치한 패키지가 사라질 때.
  • ✓설정 때 한 번만 실행할 단계와 시작할 때마다 실행할 단계를 나눠야 할 때.

스킬 링크

https://github.com/smol-machines/smolvm/blob/main/docs/dev-env/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/smol-machines/smolvm/blob/main/docs/dev-env/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“오늘 설치한 패키지가 내일도 남아 있도록, 제 프로젝트용 개발 머신을 유지해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Smolfile은 첫 시작 때 설정 단계를 실행합니다. 이후 시작에서는 그 설정을 건너뛰므로, 머신은 설치된 패키지를 그대로 가진 채 빠르게 돌아옵니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

A persistent dev machine

Verified on smolvm v1.29.0 on macOS arm64, 2026-10-15, and on v1.18.2 on Linux aarch64, 2026-09-24; the Linux runs used the Smolfile with memory = 1024, for the host reason in "Platform arms". Done means a second start is fast, skips provisioning, and the packages installed in the first session are still there. The Linux runs used the scripts of their date; this version's preflight and cleanup scripts ran on Linux aarch64 on v1.22.2 on 2026-10-03.

The whole use case turns on one fact: init runs once, not on every start, as smolfile.md says, and as the docs site (smolmachines.com/docs) says under "When init runs". smolvm machine create --help reads "Run command on every VM start" at v1.22.2, and "Run command once, on the machine's first start" from v1.23.7; provisioning that relies on the old line is missing on the second boot.

Procedure

1. Preflight.

scripts/preflight.sh

Read-only. restart_after_stop=verified on macOS and Linux. The script covers macOS and Linux only; elsewhere it prints unknown and a note pointing at references/windows.md, where a stopped machine starts again on v1.14.6 and v1.22.2.

2. Declare the machine. assets/dev.smolfile is a working starting point, and the one verify-persistence.sh is written against: it asserts the app user and the /app workdir that file sets. examples/python-app/python.smolfile and examples/node-app/node.smolfile in the repository are plainer examples without them.

image = "python:3.12-alpine"
net = true
cpus = 2
memory = 2048
volumes = ["./src:/app"]
init = [
  "sh -c \"id -un > /init-ran-as.txt\"",
  "sh -c \"date +%s >> /init-count.txt\"",
  "adduser -D app",
]
user = "app"
workdir = "/app"

3. Create and bring it up. Run this from the project directory: the Smolfile mounts ./src, which is relative to the working directory, and the script creates ./src there if it is missing.

scripts/create-dev-machine.sh              # name defaults to smolskill-dev
scripts/create-dev-machine.sh smolskill-myproj ./my.smolfile

It creates the machine with an explicit long-lived workload command, records the name for cleanup, starts it, waits for the workload container to answer with a value, and then reports what actually happened rather than that nothing errored:

init_ran=yes
machine_running=yes
workload_ready_after_s=0
workload_ready=yes
init_ran_as=root
exec_user=app
workdir=/app
result=up

init_ran_as=root with exec_user=app is the correct outcome, not a bug: init provisions the machine and runs as root regardless of user, while exec and shell run as user.

4. Work in it.

smolvm machine exec  --name smolskill-dev -- pip install --user requests
smolvm machine exec  --name smolskill-dev --user root -- sh -c 'mkdir -p /storage/keep'
smolvm machine shell --name smolskill-dev            # interactive, lands in workdir as `user`

5. Prove it is worth keeping.

scripts/verify-persistence.sh

It installs a package and records its version, seeds one file per filesystem, stops, starts, and then asserts each value against what it recorded. A version comparison is the point: an import that does not crash can be satisfied by a system copy and says nothing about your install. It leaves the machine running.

When the setup is done, smolvm machine stop --name smolskill-dev and give the user its name; the next machine start brings it back as it was.

6. Clean up, when the machine is no longer wanted. Not at the end of a setup: the machine is the deliverable, so leave it stopped and tell the user its name.

scripts/cleanup.sh --purge

cleanup.sh waits up to 20 seconds, polling the machine list, and prints waiting=up to 20s first: an ephemeral machine's entry retires after its run returns.

What init and user actually do, observed on v1.14.2 and again on v1.22.2

Observed, not inferred:

question observed
when does init run? on the first start, not on create, and not again
second start prints Init already completed, skipping N command(s)
which user runs init? root, even with user = "app" set
which user runs exec and shell? the Smolfile user
override per command machine exec --user root works
is there machine start --init? no

What survives a stop and start

| location | surviv

자주 묻는 질문

재시작 후 패키지가 사라진 이유는 무엇인가요?

시작할 때마다 실행되어야 하는 설정 단계가 재시작 후 빠질 수 있으므로, 스킬은 버전을 확인하는 방법을 설명합니다.

특별한 설정 파일이 필요한가요?

네. 스킬은 프로젝트에 맞게 고칠 수 있는 시작용 Smolfile을 제공합니다.

Windows에서도 되나요?

스킬의 점검은 macOS와 Linux를 다룹니다. Windows에서는 이전 버전에서 중지된 머신이 어떻게 동작하는지 안내합니다.

상세 정보

작성자의 원본 설명

Keeps a persistent smolvm machine with its dependencies already installed and re-enters it cheaply across sessions. Use when a project needs an isolated development environment that survives stop and start; when deciding what belongs in a Smolfile's init versus what has to run on every boot; when a package installed in a machine has vanished after a restart; or when exec answers "the container smolvm-<hash> is not running". Do not use it for untrusted code, which needs a machine that leaves nothing behind (see the throwaway-machine packet), or for running a Docker daemon inside the machine (se

repo: smol-machines/smolvm

인기도

GitHub 스타
6.9k
순위
#13717
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬