pack
ما الذي تفعله
توضح هذه المهارة كيفية تجميع جهاز smolvm أو صورة في ملف واحد، والتحقق من بقاء البرامج المثبتة داخله بعد النقل. وهي لمن يريد مشاركة بيئة جاهزة.
متى تستخدمها
- ✓عندما تريد تسليم بيئة جاهزة في ملف واحد.
- ✓عندما يعمل ملف مُجمّع لكن البرنامج الذي ثبّتّه داخله مفقود.
- ✓عندما يرفض إصدار أقدم من smolvm تصدير جهاز تفرّع.
رابط المهارة
https://github.com/smol-machines/smolvm/blob/main/docs/pack/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“جمّع جهاز smolvm الجاهز الخاص بي في ملف واحد حتى يشغّل زميلي الإعداد نفسه.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تجمع المهارة الصورة أو الجهاز المجهّز في عنصر واحد. تكتب قيمة علامة (marker) داخل الجهاز قبل التجميع، ثم تقرؤها من العنصر لتثبت بقاء الحالة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Packing a machine into a portable artifact
For macOS first-import performance, storage seed behavior and a file-heavy reproduction, see macOS storage seeds.
Verified on smolvm v1.29.0 on macOS arm64, 2026-10-15, and on v1.14.6 on Linux aarch64, 2026-09-11; the Linux host could not run the packing steps on v1.18.2 or v1.22.2, for the reason in "Platform arms". Done means the artifact runs a command in a real VM and, for a machine pack, the state you installed is still inside it. 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 assertion that matters is a value, not a boot. A pack that lost its rootfs still boots,
still prints a guest kernel and still exits zero. The only thing that separates a good artifact
from an empty one is a marker written into the source machine before packing and read back out of
the artifact afterwards, which is what pack-machine.sh and verify-pack.sh do between them.
Procedure
1. Preflight. Read-only: starts no VM, packs nothing.
scripts/preflight.sh
The lines to read are exporter_memory_ok and image_vm_memory_ok: both pack paths boot a helper VM before they
write anything. pack create --image pulls in a VM fixed at 4 vCPUs and 8192 MiB on every release here.
pack create --from-vm boots an export helper fixed at 8192 MiB through v1.16.1, whose failure was a bare agent did not become ready within 30 seconds; from v1.16.2 it asks for 4096 MiB (on Linux half the available memory when that
is less, never under 1024), SMOLVM_EXPORT_HELPER_MEMORY_MIB=<MiB> sets it, and a failed start says The export helper asked for N MiB of memory and names the variable. exporter_memory_mib is the figure this binary will ask for, except
under a cgroup memory limit on Linux, where smolvm asks for less. From v1.16.1 the helper reuses the machine's cached
image layers (Reusing the machine's cached image layers...); on macOS arm64 on v1.16.1, 2026-09-15, that export took
1.2 s with exporter_memory_ok=no. Both lines warn and do not gate: see "What the memory lines do and do not promise".
2. Pack from an image, when you want a runnable artifact of a stock image.
scripts/pack-image.sh # alpine, ./from-image
scripts/pack-image.sh python:3.12-alpine ./mypack
This path boots the 8192 MiB pull VM, so image_vm_memory_ok is its line; --mem sets the
artifact's memory and does not reach that VM. If you pass a custom output, pass it to the
verify step too (verify-pack.sh --image ./mypack), or that step finds nothing at its defaults
and tells you so rather than passing.
3. Pack from a machine you provisioned, when the point is the state in it.
scripts/pack-machine.sh # smolskill-golden, ./from-vm
It creates the machine with a workload that stays up, waits for a value from it, writes a marker, asserts the marker on the source, stops the machine and exports it. The source assertion is not ceremony: packing a machine whose provisioning silently failed produces an artifact that runs perfectly and contains nothing, and nothing downstream will tell you.
Packing a machine that already exists, the user's own rather than one pack-machine.sh made:
the script refuses any name without the smolskill- prefix, so run its sequence by hand. Stop
the machine first: --from-vm packs a stopped machine's snapshot and refuses a running one. A
machine start afterwards is how the machine comes back. A machine provisioned by hand is verified
with a file of the user's own: --marker-path names it and --marker its expected last line.
smolvm machine exec --name myapp -- tail -1 /root/provisioned.txt # note the value on the source
smolvm machine stop --name myapp
smolvm pack create --from-vm myapp --output ./myapp-portable --single-file # one file, no sidecar
scripts/verify-pack.sh --machine ./myapp-portable --marker-path /root/provisioned.txt --marker <that value>
smolvm machine start --name myapp # the machine comes back
With no file of the user's to check, write the packet's marker before the stop,
smolvm machine exec --name myapp -- sh -c 'echo PACKED_STATE_PRESENT > /marker.txt', verify
without --marker-path, and remove /marker.txt after the start.
verify-pack.sh --machine reads the mark
الأسئلة الشائعة
كيف أعرف أن التجميع نجح؟
تقرأ المهارة قيمة العلامة من العنصر. الإقلاع الناجح وحده لا يثبت أن الحالة المثبتة موجودة.
هل يستطيع أي حاسوب تشغيل الملف؟
فقط المضيفات المتوافقة. تُبنى المهارة حول إصدارات ومنصات محددة من smolvm.
ماذا يفحص الفحص المسبق؟
هو للقراءة فقط، ويتأكد من أن الحاسوب يملك ذاكرة كافية للمسارين.
التفاصيل
الوصف الأصلي من المؤلف
Turns an image, or a machine already provisioned, into a single self-contained artifact that runs on another compatible host. Use when shipping a prepared environment as one file, when a packed artifact runs but the state installed into it is missing, when pack create fails because the VM it boots to pull or export could not start, when an older release refuses to export a branched machine, or when deciding whether to pack from an image or from a machine. Do not use it to keep a machine you re-enter, which is the dev-env packet, or to run untrusted code, which is the throwaway-machine packet.
repo: smol-machines/smolvm
الشعبية
- نجوم GitHub
- 6.9k
- الترتيب
- #13722
- الترخيص
- Apache-2.0
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
branch-and-checkpoint
6.9kيساعد وكيلك على حفظ جهاز smolvm افتراضي قيد التشغيل كنقاط حفظ، واستعادته لاحقًا، وإيقافه مؤقتًا واستئنافه، وتفريعه إلى نسخ.
coding-agent
6.9kيساعد وكيلك على تشغيل وكيل برمجة مثل Claude Code داخل جهاز smolvm افتراضي آمن مع ربط مجلد مشروعك.
credentials
6.9kيتيح لوكيلك استدعاء واجهة برمجية بمفتاحك دون أن يدخل المفتاح نفسه إلى جهازه الافتراضي، فلا يستطيع الكود غير الموثوق قراءته.
dev-env
6.9kيعلّم وكيلك إبقاء جهاز تطوير smolvm مع أدواته مثبتة، ليعود بسرعة ويحتفظ بالحزم بين الجلسات.
مهارات مشابهة
openclaw-update
394kيساعد وكيلك على تحديث بوابة OpenClaw Gateway الموجودة، مع اختيار طريقة التحديث المناسبة لطريقة تثبيتها والحفاظ على جلستك.
diagnose-gateway
394kيساعد وكيلك على معرفة سبب فشل بوابة OpenClaw Gateway عبر فحص الإعدادات والقنوات والمنافذ دون تغيير أي شيء.
crabbox-apps
394kيساعد وكيلك على فتح تطبيق وتشغيله على جهاز سحابي مؤقت، ثم عرض واجهته في الشريط الجانبي للدردشة.