clonebox 0.1.9__tar.gz → 0.1.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clonebox-0.1.9/src/clonebox.egg-info → clonebox-0.1.11}/PKG-INFO +290 -8
- {clonebox-0.1.9 → clonebox-0.1.11}/README.md +290 -8
- {clonebox-0.1.9 → clonebox-0.1.11}/pyproject.toml +1 -1
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox/__init__.py +1 -1
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox/cli.py +307 -1
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox/cloner.py +2 -1
- {clonebox-0.1.9 → clonebox-0.1.11/src/clonebox.egg-info}/PKG-INFO +290 -8
- {clonebox-0.1.9 → clonebox-0.1.11}/LICENSE +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/setup.cfg +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox/__main__.py +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox/detector.py +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox.egg-info/SOURCES.txt +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox.egg-info/dependency_links.txt +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox.egg-info/entry_points.txt +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox.egg-info/requires.txt +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/src/clonebox.egg-info/top_level.txt +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/tests/test_cli.py +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/tests/test_cloner.py +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/tests/test_detector.py +0 -0
- {clonebox-0.1.9 → clonebox-0.1.11}/tests/test_network.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clonebox
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: Clone your workstation environment to an isolated VM with selective apps, paths and services
|
|
5
5
|
Author: CloneBox Team
|
|
6
6
|
License: Apache-2.0
|
|
@@ -64,6 +64,41 @@ CloneBox lets you create isolated virtual machines with only the applications, d
|
|
|
64
64
|
- 🖥️ **GUI support** - SPICE graphics with virt-viewer integration
|
|
65
65
|
- ⚡ **Fast creation** - No full disk cloning, VMs are ready in seconds
|
|
66
66
|
- 📥 **Auto-download** - Automatically downloads and caches Ubuntu cloud images (stored in ~/Downloads)
|
|
67
|
+
- 📊 **Health monitoring** - Built-in health checks for packages, services, and mounts
|
|
68
|
+
- 🔄 **VM migration** - Export/import VMs with data between workstations
|
|
69
|
+
- 🧪 **Configuration testing** - Validate VM settings and functionality
|
|
70
|
+
- 📁 **App data sync** - Include browser profiles, IDE settings, and app configs
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
CloneBox to narzędzie CLI do **szybkiego klonowania aktualnego środowiska workstation do izolowanej maszyny wirtualnej (VM)**.
|
|
76
|
+
Zamiast pełnego kopiowania dysku, używa **bind mounts** (udostępnianie katalogów na żywo) i **cloud-init** do selektywnego przeniesienia tylko potrzebnych elementów: uruchomionych usług (Docker, PostgreSQL, nginx), aplikacji, ścieżek projektów i konfiguracji. Automatycznie pobiera obrazy Ubuntu, instaluje pakiety i uruchamia VM z SPICE GUI. Idealne dla deweloperów na Linuxie – VM powstaje w minuty, bez duplikowania danych.
|
|
77
|
+
|
|
78
|
+
Kluczowe komendy:
|
|
79
|
+
- `clonebox` – interaktywny wizard (detect + create + start)
|
|
80
|
+
- `clonebox detect` – skanuje usługi/apps/ścieżki
|
|
81
|
+
- `clonebox clone . --user --run` – szybki klon bieżącego katalogu z użytkownikiem i autostartem
|
|
82
|
+
|
|
83
|
+
### Dlaczego wirtualne klony workstation mają sens?
|
|
84
|
+
|
|
85
|
+
**Problem**: Developerzy/Vibecoderzy nie izolują środowisk dev/test (np. dla AI agentów), bo ręczne odtwarzanie setupu to ból – godziny na instalację apps, usług, configów, dotfiles. Przechodzenie z fizycznego PC na VM wymagałoby pełnego rebuilda, co blokuje workflow.
|
|
86
|
+
|
|
87
|
+
**Rozwiązanie CloneBox**: Automatycznie **skanuje i klonuje stan "tu i teraz"** (usługi z `ps`, dockery z `docker ps`, projekty z git/.env). VM dziedziczy środowisko bez kopiowania całego śmietnika – tylko wybrane bind mounty.
|
|
88
|
+
|
|
89
|
+
**Korzyści w twoim kontekście (embedded/distributed systems, AI automation)**:
|
|
90
|
+
- **Sandbox dla eksperymentów**: Testuj AI agenty, edge computing (RPi/ESP32 symulacje) czy Camel/ERP integracje w izolacji, bez psucia hosta.
|
|
91
|
+
- **Reprodukcja workstation**: Na firmowym PC masz setup z domu (Python/Rust/Go envs, Docker compose, Postgres dev DB) – klonujesz i pracujesz identycznie.
|
|
92
|
+
- **Szybkość > dotfiles**: Dotfiles odtwarzają configi, ale nie łapią runtime stanu (uruchomione serwery, otwarte projekty). CloneBox to "snapshot na sterydach".
|
|
93
|
+
- **Bezpieczeństwo/cost-optymalizacja**: Izolacja od plików hosta (tylko mounts), zero downtime, tanie w zasobach (libvirt/QEMU). Dla SME: szybki onboarding dev env bez migracji fizycznej.
|
|
94
|
+
- **AI-friendly**: Agenci LLMs (jak te z twoich hobby) mogą działać w VM z pełnym kontekstem, bez ryzyka "zasmiecania" main PC.
|
|
95
|
+
|
|
96
|
+
Przykład: Masz uruchomiony Kubernetes Podman z twoim home labem + projekt automotive leasing. `clonebox clone ~/projects --run` → VM gotowa w 30s, z tymi samymi serwisami, ale izolowana. Lepsze niż Docker (brak GUI/full OS) czy pełna migracja.
|
|
97
|
+
|
|
98
|
+
**Dlaczego ludzie tego nie robią?** Brak automatyzacji – nikt nie chce ręcznie rebuildować.
|
|
99
|
+
- CloneBox rozwiązuje to jednym poleceniem. Super match dla twoich interesów (distributed infra, AI tools, business automation).
|
|
100
|
+
|
|
101
|
+
|
|
67
102
|
|
|
68
103
|
## Installation
|
|
69
104
|
|
|
@@ -142,7 +177,6 @@ Simply run `clonebox` to start the interactive wizard:
|
|
|
142
177
|
```bash
|
|
143
178
|
clonebox
|
|
144
179
|
clonebox clone . --user --run --replace --base-image ~/ubuntu-22.04-cloud.qcow2
|
|
145
|
-
|
|
146
180
|
```
|
|
147
181
|
|
|
148
182
|
The wizard will:
|
|
@@ -181,6 +215,130 @@ clonebox detect --json
|
|
|
181
215
|
|
|
182
216
|
## Usage Examples
|
|
183
217
|
|
|
218
|
+
### Basic Workflow
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# 1. Clone current directory with auto-detection
|
|
222
|
+
clonebox clone . --user
|
|
223
|
+
|
|
224
|
+
# 2. Review generated config
|
|
225
|
+
cat .clonebox.yaml
|
|
226
|
+
|
|
227
|
+
# 3. Create and start VM
|
|
228
|
+
clonebox start . --user --viewer
|
|
229
|
+
|
|
230
|
+
# 4. Check VM status
|
|
231
|
+
clonebox status . --user
|
|
232
|
+
|
|
233
|
+
# 5. Open VM window later
|
|
234
|
+
clonebox open . --user
|
|
235
|
+
|
|
236
|
+
# 6. Stop VM when done
|
|
237
|
+
clonebox stop . --user
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Development Environment with Browser Profiles
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Clone with app data (browser profiles, IDE settings)
|
|
244
|
+
clonebox clone . --user --run
|
|
245
|
+
|
|
246
|
+
# VM will have:
|
|
247
|
+
# - All your project directories
|
|
248
|
+
# - Browser profiles (Chrome, Firefox) with bookmarks and passwords
|
|
249
|
+
# - IDE settings (PyCharm, VSCode)
|
|
250
|
+
# - Docker containers and services
|
|
251
|
+
|
|
252
|
+
# Access in VM:
|
|
253
|
+
ls ~/.config/google-chrome # Chrome profile
|
|
254
|
+
ls ~/.mozilla/firefox # Firefox profile
|
|
255
|
+
ls ~/.config/JetBrains # PyCharm settings
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Testing VM Configuration
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Quick test - basic checks
|
|
262
|
+
clonebox test . --user --quick
|
|
263
|
+
|
|
264
|
+
# Full test with verbose output
|
|
265
|
+
clonebox test . --user --verbose
|
|
266
|
+
|
|
267
|
+
# Test output shows:
|
|
268
|
+
# ✅ VM is defined in libvirt
|
|
269
|
+
# ✅ VM is running
|
|
270
|
+
# ✅ VM has network access (IP: 192.168.122.89)
|
|
271
|
+
# ✅ Cloud-init completed
|
|
272
|
+
# ✅ All mount points accessible
|
|
273
|
+
# ✅ Health check triggered
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### VM Health Monitoring
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# Check overall status
|
|
280
|
+
clonebox status . --user
|
|
281
|
+
|
|
282
|
+
# Output:
|
|
283
|
+
# 📊 Checking VM status: clone-clonebox
|
|
284
|
+
# ✅ VM State: running
|
|
285
|
+
# ✅ VM has network access
|
|
286
|
+
# ☁️ Cloud-init: Still running (packages installing)
|
|
287
|
+
# 🏥 Health Check Status... ⏳ Health check not yet run
|
|
288
|
+
|
|
289
|
+
# Trigger health check
|
|
290
|
+
clonebox status . --user --health
|
|
291
|
+
|
|
292
|
+
# View detailed health report in VM:
|
|
293
|
+
# cat /var/log/clonebox-health.log
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Export/Import Workflow
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# On workstation A - Export VM with all data
|
|
300
|
+
clonebox export . --user --include-data -o my-dev-env.tar.gz
|
|
301
|
+
|
|
302
|
+
# Transfer file to workstation B, then import
|
|
303
|
+
clonebox import my-dev-env.tar.gz --user
|
|
304
|
+
|
|
305
|
+
# Start VM on new workstation
|
|
306
|
+
clonebox start . --user
|
|
307
|
+
clonebox open . --user
|
|
308
|
+
|
|
309
|
+
# VM includes:
|
|
310
|
+
# - Complete disk image
|
|
311
|
+
# - All browser profiles and settings
|
|
312
|
+
# - Project files
|
|
313
|
+
# - Docker images and containers
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Troubleshooting Common Issues
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
# If mounts are empty after reboot:
|
|
320
|
+
clonebox status . --user # Check VM status
|
|
321
|
+
# Then in VM:
|
|
322
|
+
sudo mount -a # Remount all fstab entries
|
|
323
|
+
|
|
324
|
+
# If browser profiles don't sync:
|
|
325
|
+
rm .clonebox.yaml
|
|
326
|
+
clonebox clone . --user --run --replace
|
|
327
|
+
|
|
328
|
+
# If GUI doesn't open:
|
|
329
|
+
clonebox open . --user # Easiest way
|
|
330
|
+
# or:
|
|
331
|
+
virt-viewer --connect qemu:///session clone-clonebox
|
|
332
|
+
|
|
333
|
+
# Check VM details:
|
|
334
|
+
clonebox list # List all VMs
|
|
335
|
+
virsh --connect qemu:///session dominfo clone-clonebox
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## Legacy Examples (Manual Config)
|
|
339
|
+
|
|
340
|
+
These examples use the older `create` command with manual JSON config. For most users, the `clone` command with auto-detection is easier.
|
|
341
|
+
|
|
184
342
|
### Python Development Environment
|
|
185
343
|
|
|
186
344
|
```bash
|
|
@@ -222,17 +380,36 @@ clonebox create --name fullstack --config '{
|
|
|
222
380
|
|
|
223
381
|
## Inside the VM
|
|
224
382
|
|
|
225
|
-
After the VM boots,
|
|
383
|
+
After the VM boots, shared directories are automatically mounted via fstab entries. You can check their status:
|
|
226
384
|
|
|
227
385
|
```bash
|
|
228
|
-
#
|
|
229
|
-
|
|
230
|
-
sudo mount -t 9p -o trans=virtio,version=9p2000.L mount0 /mnt/projects
|
|
386
|
+
# Check mount status
|
|
387
|
+
mount | grep 9p
|
|
231
388
|
|
|
232
|
-
#
|
|
233
|
-
|
|
389
|
+
# View health check report
|
|
390
|
+
cat /var/log/clonebox-health.log
|
|
391
|
+
|
|
392
|
+
# Re-run health check manually
|
|
393
|
+
clonebox-health
|
|
394
|
+
|
|
395
|
+
# Check cloud-init status
|
|
396
|
+
sudo cloud-init status
|
|
397
|
+
|
|
398
|
+
# Manual mount (if needed)
|
|
399
|
+
sudo mkdir -p /mnt/projects
|
|
400
|
+
sudo mount -t 9p -o trans=virtio,version=9p2000.L,nofail mount0 /mnt/projects
|
|
234
401
|
```
|
|
235
402
|
|
|
403
|
+
### Health Check System
|
|
404
|
+
|
|
405
|
+
CloneBox includes automated health checks that verify:
|
|
406
|
+
- Package installation (apt/snap)
|
|
407
|
+
- Service status
|
|
408
|
+
- Mount points accessibility
|
|
409
|
+
- GUI readiness
|
|
410
|
+
|
|
411
|
+
Health check logs are saved to `/var/log/clonebox-health.log` with a summary in `/var/log/clonebox-health-status`.
|
|
412
|
+
|
|
236
413
|
## Architecture
|
|
237
414
|
|
|
238
415
|
```
|
|
@@ -399,6 +576,7 @@ clonebox clone . --network auto
|
|
|
399
576
|
| `clonebox clone . --network user` | Use user-mode networking (slirp) |
|
|
400
577
|
| `clonebox clone . --network auto` | Auto-detect network mode (default) |
|
|
401
578
|
| `clonebox start .` | Start VM from `.clonebox.yaml` in current dir |
|
|
579
|
+
| `clonebox start . --viewer` | Start VM and open GUI window |
|
|
402
580
|
| `clonebox start <name>` | Start existing VM by name |
|
|
403
581
|
| `clonebox stop <name>` | Stop a VM (graceful shutdown) |
|
|
404
582
|
| `clonebox stop -f <name>` | Force stop a VM |
|
|
@@ -408,6 +586,14 @@ clonebox clone . --network auto
|
|
|
408
586
|
| `clonebox detect --yaml` | Output as YAML config |
|
|
409
587
|
| `clonebox detect --yaml --dedupe` | YAML with duplicates removed |
|
|
410
588
|
| `clonebox detect --json` | Output as JSON |
|
|
589
|
+
| `clonebox status . --user` | Check VM health, cloud-init status, and IP address |
|
|
590
|
+
| `clonebox test . --user` | Test VM configuration and validate all settings |
|
|
591
|
+
| `clonebox export . --user` | Export VM for migration to another workstation |
|
|
592
|
+
| `clonebox export . --user --include-data` | Export VM with browser profiles and configs |
|
|
593
|
+
| `clonebox import archive.tar.gz --user` | Import VM from export archive |
|
|
594
|
+
| `clonebox open . --user` | Open GUI viewer for VM (same as virt-viewer) |
|
|
595
|
+
| `virt-viewer --connect qemu:///session <vm>` | Open GUI for running VM |
|
|
596
|
+
| `virsh --connect qemu:///session console <vm>` | Open text console (Ctrl+] to exit) |
|
|
411
597
|
|
|
412
598
|
## Requirements
|
|
413
599
|
|
|
@@ -479,6 +665,102 @@ sudo apt install virt-viewer
|
|
|
479
665
|
virt-viewer --connect qemu:///session <vm-name>
|
|
480
666
|
```
|
|
481
667
|
|
|
668
|
+
### Browser Profiles Not Syncing
|
|
669
|
+
|
|
670
|
+
If browser profiles or app data aren't available:
|
|
671
|
+
|
|
672
|
+
1. **Regenerate config with app data:**
|
|
673
|
+
```bash
|
|
674
|
+
rm .clonebox.yaml
|
|
675
|
+
clonebox clone . --user --run --replace
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
2. **Check mount permissions in VM:**
|
|
679
|
+
```bash
|
|
680
|
+
# Verify mounts are accessible
|
|
681
|
+
ls -la ~/.config/google-chrome
|
|
682
|
+
ls -la ~/.mozilla/firefox
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
### Mount Points Empty After Reboot
|
|
686
|
+
|
|
687
|
+
If shared directories appear empty after VM restart:
|
|
688
|
+
|
|
689
|
+
1. **Check fstab entries:**
|
|
690
|
+
```bash
|
|
691
|
+
cat /etc/fstab | grep 9p
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
2. **Mount manually:**
|
|
695
|
+
```bash
|
|
696
|
+
sudo mount -a
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
3. **Verify access mode:**
|
|
700
|
+
- VMs created with `accessmode="mapped"` allow any user to access mounts
|
|
701
|
+
- Older VMs used `accessmode="passthrough"` which preserves host UIDs
|
|
702
|
+
|
|
703
|
+
## Advanced Usage
|
|
704
|
+
|
|
705
|
+
### VM Migration Between Workstations
|
|
706
|
+
|
|
707
|
+
Export your complete VM environment:
|
|
708
|
+
|
|
709
|
+
```bash
|
|
710
|
+
# Export VM with all data
|
|
711
|
+
clonebox export . --user --include-data -o my-dev-env.tar.gz
|
|
712
|
+
|
|
713
|
+
# Transfer to new workstation, then import
|
|
714
|
+
clonebox import my-dev-env.tar.gz --user
|
|
715
|
+
clonebox start . --user
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
### Testing VM Configuration
|
|
719
|
+
|
|
720
|
+
Validate your VM setup:
|
|
721
|
+
|
|
722
|
+
```bash
|
|
723
|
+
# Quick test (basic checks)
|
|
724
|
+
clonebox test . --user --quick
|
|
725
|
+
|
|
726
|
+
# Full test (includes health checks)
|
|
727
|
+
clonebox test . --user --verbose
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
### Monitoring VM Health
|
|
731
|
+
|
|
732
|
+
Check VM status from workstation:
|
|
733
|
+
|
|
734
|
+
```bash
|
|
735
|
+
# Check VM state, IP, cloud-init, and health
|
|
736
|
+
clonebox status . --user
|
|
737
|
+
|
|
738
|
+
# Trigger health check in VM
|
|
739
|
+
clonebox status . --user --health
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
### Reopening VM Window
|
|
743
|
+
|
|
744
|
+
If you close the VM window, you can reopen it:
|
|
745
|
+
|
|
746
|
+
```bash
|
|
747
|
+
# Open GUI viewer (easiest)
|
|
748
|
+
clonebox open . --user
|
|
749
|
+
|
|
750
|
+
# Start VM and open GUI (if VM is stopped)
|
|
751
|
+
clonebox start . --user --viewer
|
|
752
|
+
|
|
753
|
+
# Open GUI for running VM
|
|
754
|
+
virt-viewer --connect qemu:///session clone-clonebox
|
|
755
|
+
|
|
756
|
+
# List VMs to get the correct name
|
|
757
|
+
clonebox list
|
|
758
|
+
|
|
759
|
+
# Text console (no GUI)
|
|
760
|
+
virsh --connect qemu:///session console clone-clonebox
|
|
761
|
+
# Press Ctrl + ] to exit console
|
|
762
|
+
```
|
|
763
|
+
|
|
482
764
|
## License
|
|
483
765
|
|
|
484
766
|
MIT License - see [LICENSE](LICENSE) file.
|
|
@@ -25,6 +25,41 @@ CloneBox lets you create isolated virtual machines with only the applications, d
|
|
|
25
25
|
- 🖥️ **GUI support** - SPICE graphics with virt-viewer integration
|
|
26
26
|
- ⚡ **Fast creation** - No full disk cloning, VMs are ready in seconds
|
|
27
27
|
- 📥 **Auto-download** - Automatically downloads and caches Ubuntu cloud images (stored in ~/Downloads)
|
|
28
|
+
- 📊 **Health monitoring** - Built-in health checks for packages, services, and mounts
|
|
29
|
+
- 🔄 **VM migration** - Export/import VMs with data between workstations
|
|
30
|
+
- 🧪 **Configuration testing** - Validate VM settings and functionality
|
|
31
|
+
- 📁 **App data sync** - Include browser profiles, IDE settings, and app configs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
CloneBox to narzędzie CLI do **szybkiego klonowania aktualnego środowiska workstation do izolowanej maszyny wirtualnej (VM)**.
|
|
37
|
+
Zamiast pełnego kopiowania dysku, używa **bind mounts** (udostępnianie katalogów na żywo) i **cloud-init** do selektywnego przeniesienia tylko potrzebnych elementów: uruchomionych usług (Docker, PostgreSQL, nginx), aplikacji, ścieżek projektów i konfiguracji. Automatycznie pobiera obrazy Ubuntu, instaluje pakiety i uruchamia VM z SPICE GUI. Idealne dla deweloperów na Linuxie – VM powstaje w minuty, bez duplikowania danych.
|
|
38
|
+
|
|
39
|
+
Kluczowe komendy:
|
|
40
|
+
- `clonebox` – interaktywny wizard (detect + create + start)
|
|
41
|
+
- `clonebox detect` – skanuje usługi/apps/ścieżki
|
|
42
|
+
- `clonebox clone . --user --run` – szybki klon bieżącego katalogu z użytkownikiem i autostartem
|
|
43
|
+
|
|
44
|
+
### Dlaczego wirtualne klony workstation mają sens?
|
|
45
|
+
|
|
46
|
+
**Problem**: Developerzy/Vibecoderzy nie izolują środowisk dev/test (np. dla AI agentów), bo ręczne odtwarzanie setupu to ból – godziny na instalację apps, usług, configów, dotfiles. Przechodzenie z fizycznego PC na VM wymagałoby pełnego rebuilda, co blokuje workflow.
|
|
47
|
+
|
|
48
|
+
**Rozwiązanie CloneBox**: Automatycznie **skanuje i klonuje stan "tu i teraz"** (usługi z `ps`, dockery z `docker ps`, projekty z git/.env). VM dziedziczy środowisko bez kopiowania całego śmietnika – tylko wybrane bind mounty.
|
|
49
|
+
|
|
50
|
+
**Korzyści w twoim kontekście (embedded/distributed systems, AI automation)**:
|
|
51
|
+
- **Sandbox dla eksperymentów**: Testuj AI agenty, edge computing (RPi/ESP32 symulacje) czy Camel/ERP integracje w izolacji, bez psucia hosta.
|
|
52
|
+
- **Reprodukcja workstation**: Na firmowym PC masz setup z domu (Python/Rust/Go envs, Docker compose, Postgres dev DB) – klonujesz i pracujesz identycznie.
|
|
53
|
+
- **Szybkość > dotfiles**: Dotfiles odtwarzają configi, ale nie łapią runtime stanu (uruchomione serwery, otwarte projekty). CloneBox to "snapshot na sterydach".
|
|
54
|
+
- **Bezpieczeństwo/cost-optymalizacja**: Izolacja od plików hosta (tylko mounts), zero downtime, tanie w zasobach (libvirt/QEMU). Dla SME: szybki onboarding dev env bez migracji fizycznej.
|
|
55
|
+
- **AI-friendly**: Agenci LLMs (jak te z twoich hobby) mogą działać w VM z pełnym kontekstem, bez ryzyka "zasmiecania" main PC.
|
|
56
|
+
|
|
57
|
+
Przykład: Masz uruchomiony Kubernetes Podman z twoim home labem + projekt automotive leasing. `clonebox clone ~/projects --run` → VM gotowa w 30s, z tymi samymi serwisami, ale izolowana. Lepsze niż Docker (brak GUI/full OS) czy pełna migracja.
|
|
58
|
+
|
|
59
|
+
**Dlaczego ludzie tego nie robią?** Brak automatyzacji – nikt nie chce ręcznie rebuildować.
|
|
60
|
+
- CloneBox rozwiązuje to jednym poleceniem. Super match dla twoich interesów (distributed infra, AI tools, business automation).
|
|
61
|
+
|
|
62
|
+
|
|
28
63
|
|
|
29
64
|
## Installation
|
|
30
65
|
|
|
@@ -103,7 +138,6 @@ Simply run `clonebox` to start the interactive wizard:
|
|
|
103
138
|
```bash
|
|
104
139
|
clonebox
|
|
105
140
|
clonebox clone . --user --run --replace --base-image ~/ubuntu-22.04-cloud.qcow2
|
|
106
|
-
|
|
107
141
|
```
|
|
108
142
|
|
|
109
143
|
The wizard will:
|
|
@@ -142,6 +176,130 @@ clonebox detect --json
|
|
|
142
176
|
|
|
143
177
|
## Usage Examples
|
|
144
178
|
|
|
179
|
+
### Basic Workflow
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# 1. Clone current directory with auto-detection
|
|
183
|
+
clonebox clone . --user
|
|
184
|
+
|
|
185
|
+
# 2. Review generated config
|
|
186
|
+
cat .clonebox.yaml
|
|
187
|
+
|
|
188
|
+
# 3. Create and start VM
|
|
189
|
+
clonebox start . --user --viewer
|
|
190
|
+
|
|
191
|
+
# 4. Check VM status
|
|
192
|
+
clonebox status . --user
|
|
193
|
+
|
|
194
|
+
# 5. Open VM window later
|
|
195
|
+
clonebox open . --user
|
|
196
|
+
|
|
197
|
+
# 6. Stop VM when done
|
|
198
|
+
clonebox stop . --user
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Development Environment with Browser Profiles
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Clone with app data (browser profiles, IDE settings)
|
|
205
|
+
clonebox clone . --user --run
|
|
206
|
+
|
|
207
|
+
# VM will have:
|
|
208
|
+
# - All your project directories
|
|
209
|
+
# - Browser profiles (Chrome, Firefox) with bookmarks and passwords
|
|
210
|
+
# - IDE settings (PyCharm, VSCode)
|
|
211
|
+
# - Docker containers and services
|
|
212
|
+
|
|
213
|
+
# Access in VM:
|
|
214
|
+
ls ~/.config/google-chrome # Chrome profile
|
|
215
|
+
ls ~/.mozilla/firefox # Firefox profile
|
|
216
|
+
ls ~/.config/JetBrains # PyCharm settings
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Testing VM Configuration
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Quick test - basic checks
|
|
223
|
+
clonebox test . --user --quick
|
|
224
|
+
|
|
225
|
+
# Full test with verbose output
|
|
226
|
+
clonebox test . --user --verbose
|
|
227
|
+
|
|
228
|
+
# Test output shows:
|
|
229
|
+
# ✅ VM is defined in libvirt
|
|
230
|
+
# ✅ VM is running
|
|
231
|
+
# ✅ VM has network access (IP: 192.168.122.89)
|
|
232
|
+
# ✅ Cloud-init completed
|
|
233
|
+
# ✅ All mount points accessible
|
|
234
|
+
# ✅ Health check triggered
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### VM Health Monitoring
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Check overall status
|
|
241
|
+
clonebox status . --user
|
|
242
|
+
|
|
243
|
+
# Output:
|
|
244
|
+
# 📊 Checking VM status: clone-clonebox
|
|
245
|
+
# ✅ VM State: running
|
|
246
|
+
# ✅ VM has network access
|
|
247
|
+
# ☁️ Cloud-init: Still running (packages installing)
|
|
248
|
+
# 🏥 Health Check Status... ⏳ Health check not yet run
|
|
249
|
+
|
|
250
|
+
# Trigger health check
|
|
251
|
+
clonebox status . --user --health
|
|
252
|
+
|
|
253
|
+
# View detailed health report in VM:
|
|
254
|
+
# cat /var/log/clonebox-health.log
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Export/Import Workflow
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# On workstation A - Export VM with all data
|
|
261
|
+
clonebox export . --user --include-data -o my-dev-env.tar.gz
|
|
262
|
+
|
|
263
|
+
# Transfer file to workstation B, then import
|
|
264
|
+
clonebox import my-dev-env.tar.gz --user
|
|
265
|
+
|
|
266
|
+
# Start VM on new workstation
|
|
267
|
+
clonebox start . --user
|
|
268
|
+
clonebox open . --user
|
|
269
|
+
|
|
270
|
+
# VM includes:
|
|
271
|
+
# - Complete disk image
|
|
272
|
+
# - All browser profiles and settings
|
|
273
|
+
# - Project files
|
|
274
|
+
# - Docker images and containers
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Troubleshooting Common Issues
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# If mounts are empty after reboot:
|
|
281
|
+
clonebox status . --user # Check VM status
|
|
282
|
+
# Then in VM:
|
|
283
|
+
sudo mount -a # Remount all fstab entries
|
|
284
|
+
|
|
285
|
+
# If browser profiles don't sync:
|
|
286
|
+
rm .clonebox.yaml
|
|
287
|
+
clonebox clone . --user --run --replace
|
|
288
|
+
|
|
289
|
+
# If GUI doesn't open:
|
|
290
|
+
clonebox open . --user # Easiest way
|
|
291
|
+
# or:
|
|
292
|
+
virt-viewer --connect qemu:///session clone-clonebox
|
|
293
|
+
|
|
294
|
+
# Check VM details:
|
|
295
|
+
clonebox list # List all VMs
|
|
296
|
+
virsh --connect qemu:///session dominfo clone-clonebox
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Legacy Examples (Manual Config)
|
|
300
|
+
|
|
301
|
+
These examples use the older `create` command with manual JSON config. For most users, the `clone` command with auto-detection is easier.
|
|
302
|
+
|
|
145
303
|
### Python Development Environment
|
|
146
304
|
|
|
147
305
|
```bash
|
|
@@ -183,17 +341,36 @@ clonebox create --name fullstack --config '{
|
|
|
183
341
|
|
|
184
342
|
## Inside the VM
|
|
185
343
|
|
|
186
|
-
After the VM boots,
|
|
344
|
+
After the VM boots, shared directories are automatically mounted via fstab entries. You can check their status:
|
|
187
345
|
|
|
188
346
|
```bash
|
|
189
|
-
#
|
|
190
|
-
|
|
191
|
-
sudo mount -t 9p -o trans=virtio,version=9p2000.L mount0 /mnt/projects
|
|
347
|
+
# Check mount status
|
|
348
|
+
mount | grep 9p
|
|
192
349
|
|
|
193
|
-
#
|
|
194
|
-
|
|
350
|
+
# View health check report
|
|
351
|
+
cat /var/log/clonebox-health.log
|
|
352
|
+
|
|
353
|
+
# Re-run health check manually
|
|
354
|
+
clonebox-health
|
|
355
|
+
|
|
356
|
+
# Check cloud-init status
|
|
357
|
+
sudo cloud-init status
|
|
358
|
+
|
|
359
|
+
# Manual mount (if needed)
|
|
360
|
+
sudo mkdir -p /mnt/projects
|
|
361
|
+
sudo mount -t 9p -o trans=virtio,version=9p2000.L,nofail mount0 /mnt/projects
|
|
195
362
|
```
|
|
196
363
|
|
|
364
|
+
### Health Check System
|
|
365
|
+
|
|
366
|
+
CloneBox includes automated health checks that verify:
|
|
367
|
+
- Package installation (apt/snap)
|
|
368
|
+
- Service status
|
|
369
|
+
- Mount points accessibility
|
|
370
|
+
- GUI readiness
|
|
371
|
+
|
|
372
|
+
Health check logs are saved to `/var/log/clonebox-health.log` with a summary in `/var/log/clonebox-health-status`.
|
|
373
|
+
|
|
197
374
|
## Architecture
|
|
198
375
|
|
|
199
376
|
```
|
|
@@ -360,6 +537,7 @@ clonebox clone . --network auto
|
|
|
360
537
|
| `clonebox clone . --network user` | Use user-mode networking (slirp) |
|
|
361
538
|
| `clonebox clone . --network auto` | Auto-detect network mode (default) |
|
|
362
539
|
| `clonebox start .` | Start VM from `.clonebox.yaml` in current dir |
|
|
540
|
+
| `clonebox start . --viewer` | Start VM and open GUI window |
|
|
363
541
|
| `clonebox start <name>` | Start existing VM by name |
|
|
364
542
|
| `clonebox stop <name>` | Stop a VM (graceful shutdown) |
|
|
365
543
|
| `clonebox stop -f <name>` | Force stop a VM |
|
|
@@ -369,6 +547,14 @@ clonebox clone . --network auto
|
|
|
369
547
|
| `clonebox detect --yaml` | Output as YAML config |
|
|
370
548
|
| `clonebox detect --yaml --dedupe` | YAML with duplicates removed |
|
|
371
549
|
| `clonebox detect --json` | Output as JSON |
|
|
550
|
+
| `clonebox status . --user` | Check VM health, cloud-init status, and IP address |
|
|
551
|
+
| `clonebox test . --user` | Test VM configuration and validate all settings |
|
|
552
|
+
| `clonebox export . --user` | Export VM for migration to another workstation |
|
|
553
|
+
| `clonebox export . --user --include-data` | Export VM with browser profiles and configs |
|
|
554
|
+
| `clonebox import archive.tar.gz --user` | Import VM from export archive |
|
|
555
|
+
| `clonebox open . --user` | Open GUI viewer for VM (same as virt-viewer) |
|
|
556
|
+
| `virt-viewer --connect qemu:///session <vm>` | Open GUI for running VM |
|
|
557
|
+
| `virsh --connect qemu:///session console <vm>` | Open text console (Ctrl+] to exit) |
|
|
372
558
|
|
|
373
559
|
## Requirements
|
|
374
560
|
|
|
@@ -440,6 +626,102 @@ sudo apt install virt-viewer
|
|
|
440
626
|
virt-viewer --connect qemu:///session <vm-name>
|
|
441
627
|
```
|
|
442
628
|
|
|
629
|
+
### Browser Profiles Not Syncing
|
|
630
|
+
|
|
631
|
+
If browser profiles or app data aren't available:
|
|
632
|
+
|
|
633
|
+
1. **Regenerate config with app data:**
|
|
634
|
+
```bash
|
|
635
|
+
rm .clonebox.yaml
|
|
636
|
+
clonebox clone . --user --run --replace
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
2. **Check mount permissions in VM:**
|
|
640
|
+
```bash
|
|
641
|
+
# Verify mounts are accessible
|
|
642
|
+
ls -la ~/.config/google-chrome
|
|
643
|
+
ls -la ~/.mozilla/firefox
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Mount Points Empty After Reboot
|
|
647
|
+
|
|
648
|
+
If shared directories appear empty after VM restart:
|
|
649
|
+
|
|
650
|
+
1. **Check fstab entries:**
|
|
651
|
+
```bash
|
|
652
|
+
cat /etc/fstab | grep 9p
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
2. **Mount manually:**
|
|
656
|
+
```bash
|
|
657
|
+
sudo mount -a
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
3. **Verify access mode:**
|
|
661
|
+
- VMs created with `accessmode="mapped"` allow any user to access mounts
|
|
662
|
+
- Older VMs used `accessmode="passthrough"` which preserves host UIDs
|
|
663
|
+
|
|
664
|
+
## Advanced Usage
|
|
665
|
+
|
|
666
|
+
### VM Migration Between Workstations
|
|
667
|
+
|
|
668
|
+
Export your complete VM environment:
|
|
669
|
+
|
|
670
|
+
```bash
|
|
671
|
+
# Export VM with all data
|
|
672
|
+
clonebox export . --user --include-data -o my-dev-env.tar.gz
|
|
673
|
+
|
|
674
|
+
# Transfer to new workstation, then import
|
|
675
|
+
clonebox import my-dev-env.tar.gz --user
|
|
676
|
+
clonebox start . --user
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
### Testing VM Configuration
|
|
680
|
+
|
|
681
|
+
Validate your VM setup:
|
|
682
|
+
|
|
683
|
+
```bash
|
|
684
|
+
# Quick test (basic checks)
|
|
685
|
+
clonebox test . --user --quick
|
|
686
|
+
|
|
687
|
+
# Full test (includes health checks)
|
|
688
|
+
clonebox test . --user --verbose
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### Monitoring VM Health
|
|
692
|
+
|
|
693
|
+
Check VM status from workstation:
|
|
694
|
+
|
|
695
|
+
```bash
|
|
696
|
+
# Check VM state, IP, cloud-init, and health
|
|
697
|
+
clonebox status . --user
|
|
698
|
+
|
|
699
|
+
# Trigger health check in VM
|
|
700
|
+
clonebox status . --user --health
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
### Reopening VM Window
|
|
704
|
+
|
|
705
|
+
If you close the VM window, you can reopen it:
|
|
706
|
+
|
|
707
|
+
```bash
|
|
708
|
+
# Open GUI viewer (easiest)
|
|
709
|
+
clonebox open . --user
|
|
710
|
+
|
|
711
|
+
# Start VM and open GUI (if VM is stopped)
|
|
712
|
+
clonebox start . --user --viewer
|
|
713
|
+
|
|
714
|
+
# Open GUI for running VM
|
|
715
|
+
virt-viewer --connect qemu:///session clone-clonebox
|
|
716
|
+
|
|
717
|
+
# List VMs to get the correct name
|
|
718
|
+
clonebox list
|
|
719
|
+
|
|
720
|
+
# Text console (no GUI)
|
|
721
|
+
virsh --connect qemu:///session console clone-clonebox
|
|
722
|
+
# Press Ctrl + ] to exit console
|
|
723
|
+
```
|
|
724
|
+
|
|
443
725
|
## License
|
|
444
726
|
|
|
445
|
-
MIT License - see [LICENSE](LICENSE) file.
|
|
727
|
+
MIT License - see [LICENSE](LICENSE) file.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "clonebox"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.11"
|
|
8
8
|
description = "Clone your workstation environment to an isolated VM with selective apps, paths and services"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "Apache-2.0"}
|