clonebox 0.1.2__tar.gz → 0.1.4__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.2 → clonebox-0.1.4}/PKG-INFO +110 -3
- {clonebox-0.1.2 → clonebox-0.1.4}/README.md +109 -2
- {clonebox-0.1.2 → clonebox-0.1.4}/pyproject.toml +1 -1
- clonebox-0.1.4/src/clonebox/__main__.py +7 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox/cli.py +317 -265
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox/cloner.py +177 -119
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox/detector.py +186 -108
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox.egg-info/PKG-INFO +110 -3
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox.egg-info/SOURCES.txt +3 -1
- {clonebox-0.1.2 → clonebox-0.1.4}/tests/test_cli.py +51 -44
- {clonebox-0.1.2 → clonebox-0.1.4}/tests/test_cloner.py +83 -82
- {clonebox-0.1.2 → clonebox-0.1.4}/tests/test_detector.py +50 -59
- clonebox-0.1.4/tests/test_network.py +165 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/LICENSE +0 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/setup.cfg +0 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox/__init__.py +0 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox.egg-info/dependency_links.txt +0 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox.egg-info/entry_points.txt +0 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox.egg-info/requires.txt +0 -0
- {clonebox-0.1.2 → clonebox-0.1.4}/src/clonebox.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clonebox
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
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
|
|
@@ -65,7 +65,28 @@ CloneBox lets you create isolated virtual machines with only the applications, d
|
|
|
65
65
|
|
|
66
66
|
## Installation
|
|
67
67
|
|
|
68
|
-
###
|
|
68
|
+
### Quick Setup (Recommended)
|
|
69
|
+
|
|
70
|
+
Run the setup script to automatically install dependencies and configure the environment:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Clone the repository
|
|
74
|
+
git clone https://github.com/wronai/clonebox.git
|
|
75
|
+
cd clonebox
|
|
76
|
+
|
|
77
|
+
# Run the setup script
|
|
78
|
+
./setup.sh
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The setup script will:
|
|
82
|
+
- Install all required packages (QEMU, libvirt, Python, etc.)
|
|
83
|
+
- Add your user to the necessary groups
|
|
84
|
+
- Configure libvirt networks
|
|
85
|
+
- Install clonebox in development mode
|
|
86
|
+
|
|
87
|
+
### Manual Installation
|
|
88
|
+
|
|
89
|
+
#### Prerequisites
|
|
69
90
|
|
|
70
91
|
```bash
|
|
71
92
|
# Install libvirt and QEMU/KVM
|
|
@@ -82,7 +103,7 @@ newgrp libvirt
|
|
|
82
103
|
sudo apt install genisoimage
|
|
83
104
|
```
|
|
84
105
|
|
|
85
|
-
|
|
106
|
+
#### Install CloneBox
|
|
86
107
|
|
|
87
108
|
```bash
|
|
88
109
|
# From source
|
|
@@ -270,6 +291,29 @@ clonebox detect --yaml --dedupe
|
|
|
270
291
|
clonebox detect --yaml --dedupe -o my-config.yaml
|
|
271
292
|
```
|
|
272
293
|
|
|
294
|
+
### User Session & Networking
|
|
295
|
+
|
|
296
|
+
CloneBox supports creating VMs in user session (no root required) with automatic network fallback:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Create VM in user session (uses ~/.local/share/libvirt/images)
|
|
300
|
+
clonebox clone . --user
|
|
301
|
+
|
|
302
|
+
# Explicitly use user-mode networking (slirp) - works without libvirt network
|
|
303
|
+
clonebox clone . --user --network user
|
|
304
|
+
|
|
305
|
+
# Force libvirt default network (may fail in user session)
|
|
306
|
+
clonebox clone . --network default
|
|
307
|
+
|
|
308
|
+
# Auto mode (default): tries libvirt network, falls back to user-mode if unavailable
|
|
309
|
+
clonebox clone . --network auto
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Network modes:**
|
|
313
|
+
- `auto` (default): Uses libvirt default network if available, otherwise falls back to user-mode (slirp)
|
|
314
|
+
- `default`: Forces use of libvirt default network
|
|
315
|
+
- `user`: Uses user-mode networking (slirp) - no bridge setup required
|
|
316
|
+
|
|
273
317
|
## Commands Reference
|
|
274
318
|
|
|
275
319
|
| Command | Description |
|
|
@@ -278,6 +322,9 @@ clonebox detect --yaml --dedupe -o my-config.yaml
|
|
|
278
322
|
| `clonebox clone <path>` | Generate `.clonebox.yaml` from path + running processes |
|
|
279
323
|
| `clonebox clone . --run` | Clone and immediately start VM |
|
|
280
324
|
| `clonebox clone . --edit` | Clone, edit config, then create |
|
|
325
|
+
| `clonebox clone . --user` | Clone in user session (no root) |
|
|
326
|
+
| `clonebox clone . --network user` | Use user-mode networking (slirp) |
|
|
327
|
+
| `clonebox clone . --network auto` | Auto-detect network mode (default) |
|
|
281
328
|
| `clonebox start .` | Start VM from `.clonebox.yaml` in current dir |
|
|
282
329
|
| `clonebox start <name>` | Start existing VM by name |
|
|
283
330
|
| `clonebox stop <name>` | Stop a VM (graceful shutdown) |
|
|
@@ -296,6 +343,66 @@ clonebox detect --yaml --dedupe -o my-config.yaml
|
|
|
296
343
|
- Python 3.8+
|
|
297
344
|
- User in `libvirt` group
|
|
298
345
|
|
|
346
|
+
## Troubleshooting
|
|
347
|
+
|
|
348
|
+
### Network Issues
|
|
349
|
+
|
|
350
|
+
If you encounter "Network not found" or "network 'default' is not active" errors:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
# Option 1: Use user-mode networking (no setup required)
|
|
354
|
+
clonebox clone . --user --network user
|
|
355
|
+
|
|
356
|
+
# Option 2: Run the network fix script
|
|
357
|
+
./fix-network.sh
|
|
358
|
+
|
|
359
|
+
# Or manually fix:
|
|
360
|
+
virsh --connect qemu:///session net-destroy default 2>/dev/null
|
|
361
|
+
virsh --connect qemu:///session net-undefine default 2>/dev/null
|
|
362
|
+
virsh --connect qemu:///session net-define /tmp/default-network.xml
|
|
363
|
+
virsh --connect qemu:///session net-start default
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Permission Issues
|
|
367
|
+
|
|
368
|
+
If you get permission errors:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
# Ensure user is in libvirt and kvm groups
|
|
372
|
+
sudo usermod -aG libvirt $USER
|
|
373
|
+
sudo usermod -aG kvm $USER
|
|
374
|
+
|
|
375
|
+
# Log out and log back in for groups to take effect
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### VM Already Exists
|
|
379
|
+
|
|
380
|
+
If you get "domain already exists" error:
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
# List VMs
|
|
384
|
+
clonebox list
|
|
385
|
+
|
|
386
|
+
# Stop and delete the existing VM
|
|
387
|
+
clonebox delete <vm-name>
|
|
388
|
+
|
|
389
|
+
# Or use virsh directly
|
|
390
|
+
virsh --connect qemu:///session destroy <vm-name>
|
|
391
|
+
virsh --connect qemu:///session undefine <vm-name>
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### virt-viewer not found
|
|
395
|
+
|
|
396
|
+
If GUI doesn't open:
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
# Install virt-viewer
|
|
400
|
+
sudo apt install virt-viewer
|
|
401
|
+
|
|
402
|
+
# Then connect manually
|
|
403
|
+
virt-viewer --connect qemu:///session <vm-name>
|
|
404
|
+
```
|
|
405
|
+
|
|
299
406
|
## License
|
|
300
407
|
|
|
301
408
|
MIT License - see [LICENSE](LICENSE) file.
|
|
@@ -26,7 +26,28 @@ CloneBox lets you create isolated virtual machines with only the applications, d
|
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### Quick Setup (Recommended)
|
|
30
|
+
|
|
31
|
+
Run the setup script to automatically install dependencies and configure the environment:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Clone the repository
|
|
35
|
+
git clone https://github.com/wronai/clonebox.git
|
|
36
|
+
cd clonebox
|
|
37
|
+
|
|
38
|
+
# Run the setup script
|
|
39
|
+
./setup.sh
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The setup script will:
|
|
43
|
+
- Install all required packages (QEMU, libvirt, Python, etc.)
|
|
44
|
+
- Add your user to the necessary groups
|
|
45
|
+
- Configure libvirt networks
|
|
46
|
+
- Install clonebox in development mode
|
|
47
|
+
|
|
48
|
+
### Manual Installation
|
|
49
|
+
|
|
50
|
+
#### Prerequisites
|
|
30
51
|
|
|
31
52
|
```bash
|
|
32
53
|
# Install libvirt and QEMU/KVM
|
|
@@ -43,7 +64,7 @@ newgrp libvirt
|
|
|
43
64
|
sudo apt install genisoimage
|
|
44
65
|
```
|
|
45
66
|
|
|
46
|
-
|
|
67
|
+
#### Install CloneBox
|
|
47
68
|
|
|
48
69
|
```bash
|
|
49
70
|
# From source
|
|
@@ -231,6 +252,29 @@ clonebox detect --yaml --dedupe
|
|
|
231
252
|
clonebox detect --yaml --dedupe -o my-config.yaml
|
|
232
253
|
```
|
|
233
254
|
|
|
255
|
+
### User Session & Networking
|
|
256
|
+
|
|
257
|
+
CloneBox supports creating VMs in user session (no root required) with automatic network fallback:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Create VM in user session (uses ~/.local/share/libvirt/images)
|
|
261
|
+
clonebox clone . --user
|
|
262
|
+
|
|
263
|
+
# Explicitly use user-mode networking (slirp) - works without libvirt network
|
|
264
|
+
clonebox clone . --user --network user
|
|
265
|
+
|
|
266
|
+
# Force libvirt default network (may fail in user session)
|
|
267
|
+
clonebox clone . --network default
|
|
268
|
+
|
|
269
|
+
# Auto mode (default): tries libvirt network, falls back to user-mode if unavailable
|
|
270
|
+
clonebox clone . --network auto
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**Network modes:**
|
|
274
|
+
- `auto` (default): Uses libvirt default network if available, otherwise falls back to user-mode (slirp)
|
|
275
|
+
- `default`: Forces use of libvirt default network
|
|
276
|
+
- `user`: Uses user-mode networking (slirp) - no bridge setup required
|
|
277
|
+
|
|
234
278
|
## Commands Reference
|
|
235
279
|
|
|
236
280
|
| Command | Description |
|
|
@@ -239,6 +283,9 @@ clonebox detect --yaml --dedupe -o my-config.yaml
|
|
|
239
283
|
| `clonebox clone <path>` | Generate `.clonebox.yaml` from path + running processes |
|
|
240
284
|
| `clonebox clone . --run` | Clone and immediately start VM |
|
|
241
285
|
| `clonebox clone . --edit` | Clone, edit config, then create |
|
|
286
|
+
| `clonebox clone . --user` | Clone in user session (no root) |
|
|
287
|
+
| `clonebox clone . --network user` | Use user-mode networking (slirp) |
|
|
288
|
+
| `clonebox clone . --network auto` | Auto-detect network mode (default) |
|
|
242
289
|
| `clonebox start .` | Start VM from `.clonebox.yaml` in current dir |
|
|
243
290
|
| `clonebox start <name>` | Start existing VM by name |
|
|
244
291
|
| `clonebox stop <name>` | Stop a VM (graceful shutdown) |
|
|
@@ -257,6 +304,66 @@ clonebox detect --yaml --dedupe -o my-config.yaml
|
|
|
257
304
|
- Python 3.8+
|
|
258
305
|
- User in `libvirt` group
|
|
259
306
|
|
|
307
|
+
## Troubleshooting
|
|
308
|
+
|
|
309
|
+
### Network Issues
|
|
310
|
+
|
|
311
|
+
If you encounter "Network not found" or "network 'default' is not active" errors:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# Option 1: Use user-mode networking (no setup required)
|
|
315
|
+
clonebox clone . --user --network user
|
|
316
|
+
|
|
317
|
+
# Option 2: Run the network fix script
|
|
318
|
+
./fix-network.sh
|
|
319
|
+
|
|
320
|
+
# Or manually fix:
|
|
321
|
+
virsh --connect qemu:///session net-destroy default 2>/dev/null
|
|
322
|
+
virsh --connect qemu:///session net-undefine default 2>/dev/null
|
|
323
|
+
virsh --connect qemu:///session net-define /tmp/default-network.xml
|
|
324
|
+
virsh --connect qemu:///session net-start default
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Permission Issues
|
|
328
|
+
|
|
329
|
+
If you get permission errors:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Ensure user is in libvirt and kvm groups
|
|
333
|
+
sudo usermod -aG libvirt $USER
|
|
334
|
+
sudo usermod -aG kvm $USER
|
|
335
|
+
|
|
336
|
+
# Log out and log back in for groups to take effect
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### VM Already Exists
|
|
340
|
+
|
|
341
|
+
If you get "domain already exists" error:
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
# List VMs
|
|
345
|
+
clonebox list
|
|
346
|
+
|
|
347
|
+
# Stop and delete the existing VM
|
|
348
|
+
clonebox delete <vm-name>
|
|
349
|
+
|
|
350
|
+
# Or use virsh directly
|
|
351
|
+
virsh --connect qemu:///session destroy <vm-name>
|
|
352
|
+
virsh --connect qemu:///session undefine <vm-name>
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### virt-viewer not found
|
|
356
|
+
|
|
357
|
+
If GUI doesn't open:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# Install virt-viewer
|
|
361
|
+
sudo apt install virt-viewer
|
|
362
|
+
|
|
363
|
+
# Then connect manually
|
|
364
|
+
virt-viewer --connect qemu:///session <vm-name>
|
|
365
|
+
```
|
|
366
|
+
|
|
260
367
|
## License
|
|
261
368
|
|
|
262
369
|
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.4"
|
|
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"}
|