clonebox 0.1.16__py3-none-any.whl → 0.1.18__py3-none-any.whl
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/cli.py +4 -6
- clonebox/cloner.py +19 -12
- {clonebox-0.1.16.dist-info → clonebox-0.1.18.dist-info}/METADATA +1 -1
- {clonebox-0.1.16.dist-info → clonebox-0.1.18.dist-info}/RECORD +8 -8
- {clonebox-0.1.16.dist-info → clonebox-0.1.18.dist-info}/WHEEL +0 -0
- {clonebox-0.1.16.dist-info → clonebox-0.1.18.dist-info}/entry_points.txt +0 -0
- {clonebox-0.1.16.dist-info → clonebox-0.1.18.dist-info}/licenses/LICENSE +0 -0
- {clonebox-0.1.16.dist-info → clonebox-0.1.18.dist-info}/top_level.txt +0 -0
clonebox/cli.py
CHANGED
|
@@ -103,6 +103,8 @@ def _qga_ping(vm_name: str, conn_uri: str) -> bool:
|
|
|
103
103
|
|
|
104
104
|
def _qga_exec(vm_name: str, conn_uri: str, command: str, timeout: int = 10) -> Optional[str]:
|
|
105
105
|
import subprocess
|
|
106
|
+
import base64
|
|
107
|
+
import time
|
|
106
108
|
|
|
107
109
|
try:
|
|
108
110
|
payload = {
|
|
@@ -134,9 +136,6 @@ def _qga_exec(vm_name: str, conn_uri: str, command: str, timeout: int = 10) -> O
|
|
|
134
136
|
if not pid:
|
|
135
137
|
return None
|
|
136
138
|
|
|
137
|
-
import base64
|
|
138
|
-
import time
|
|
139
|
-
|
|
140
139
|
deadline = time.time() + timeout
|
|
141
140
|
while time.time() < deadline:
|
|
142
141
|
status_payload = {"execute": "guest-exec-status", "arguments": {"pid": pid}}
|
|
@@ -698,14 +697,13 @@ def interactive_mode():
|
|
|
698
697
|
if questionary.confirm("Start VM now?", default=True, style=custom_style).ask():
|
|
699
698
|
cloner.start_vm(vm_name, open_viewer=enable_gui, console=console)
|
|
700
699
|
console.print("\n[bold green]🎉 VM is running![/]")
|
|
700
|
+
console.print(f"\n[dim]UUID: {vm_uuid}[/]")
|
|
701
701
|
|
|
702
702
|
if paths_mapping:
|
|
703
703
|
console.print("\n[bold]Inside the VM, mount shared folders with:[/]")
|
|
704
704
|
for idx, (host, guest) in enumerate(paths_mapping.items()):
|
|
705
705
|
console.print(f" [cyan]sudo mount -t 9p -o trans=virtio mount{idx} {guest}[/]")
|
|
706
706
|
|
|
707
|
-
console.print(f"\n[dim]VM UUID: {vm_uuid}[/]")
|
|
708
|
-
|
|
709
707
|
except Exception as e:
|
|
710
708
|
console.print(f"\n[red]❌ Error: {e}[/]")
|
|
711
709
|
raise
|
|
@@ -942,7 +940,7 @@ def cmd_container_up(args):
|
|
|
942
940
|
"Container features require extra dependencies (e.g. pydantic). Install them to use 'clonebox container'."
|
|
943
941
|
) from e
|
|
944
942
|
|
|
945
|
-
mounts
|
|
943
|
+
mounts = {}
|
|
946
944
|
for m in getattr(args, "mount", []) or []:
|
|
947
945
|
if ":" not in m:
|
|
948
946
|
raise ValueError(f"Invalid mount: {m} (expected HOST:CONTAINER)")
|
clonebox/cloner.py
CHANGED
|
@@ -679,19 +679,27 @@ fi
|
|
|
679
679
|
|
|
680
680
|
# User-data
|
|
681
681
|
# Add desktop environment if GUI is enabled
|
|
682
|
-
runcmd_lines = []
|
|
683
682
|
base_packages = ["qemu-guest-agent"]
|
|
684
683
|
if config.gui:
|
|
685
|
-
base_packages.extend(
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
]
|
|
690
|
-
)
|
|
684
|
+
base_packages.extend([
|
|
685
|
+
"ubuntu-desktop-minimal",
|
|
686
|
+
"firefox",
|
|
687
|
+
])
|
|
691
688
|
|
|
692
689
|
all_packages = base_packages + list(config.packages)
|
|
693
|
-
packages_yaml =
|
|
690
|
+
packages_yaml = (
|
|
691
|
+
"\n".join(f" - {pkg}" for pkg in all_packages) if all_packages else ""
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
# Build runcmd - services, mounts, snaps, post_commands
|
|
695
|
+
runcmd_lines = []
|
|
694
696
|
|
|
697
|
+
runcmd_lines.append(" - systemctl enable --now qemu-guest-agent || true")
|
|
698
|
+
|
|
699
|
+
# Add service enablement
|
|
700
|
+
for svc in config.services:
|
|
701
|
+
runcmd_lines.append(f" - systemctl enable --now {svc} || true")
|
|
702
|
+
|
|
695
703
|
# Add fstab entries for persistent mounts after reboot
|
|
696
704
|
if fstab_entries:
|
|
697
705
|
runcmd_lines.append(" - grep -q '^# CloneBox 9p mounts' /etc/fstab || echo '# CloneBox 9p mounts' >> /etc/fstab")
|
|
@@ -699,10 +707,9 @@ fi
|
|
|
699
707
|
runcmd_lines.append(f" - grep -qF \"{entry}\" /etc/fstab || echo '{entry}' >> /etc/fstab")
|
|
700
708
|
runcmd_lines.append(" - mount -a || true")
|
|
701
709
|
|
|
702
|
-
#
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
runcmd_lines.append(f" - apt-get install -y {pkg} || true")
|
|
710
|
+
# Add mounts (immediate, before reboot)
|
|
711
|
+
for cmd in mount_commands:
|
|
712
|
+
runcmd_lines.append(cmd)
|
|
706
713
|
|
|
707
714
|
# Install snap packages
|
|
708
715
|
if config.snap_packages:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
clonebox/__init__.py,sha256=C1J7Uwrp8H9Zopo5JgrQYzXg-PWls1JdqmE_0Qp1Tro,408
|
|
2
2
|
clonebox/__main__.py,sha256=Fcoyzwwyz5-eC_sBlQk5a5RbKx8uodQz5sKJ190U0NU,135
|
|
3
|
-
clonebox/cli.py,sha256=
|
|
4
|
-
clonebox/cloner.py,sha256=
|
|
3
|
+
clonebox/cli.py,sha256=0Yjkq8EC5v8e402ouvPt3F3-8QSdKuMYZmOrIa8YARc,98076
|
|
4
|
+
clonebox/cloner.py,sha256=tgN51yeNGesolO1wfuVh-CAGkAZew7oMoCYYz_bXgBk,32456
|
|
5
5
|
clonebox/container.py,sha256=tiYK1ZB-DhdD6A2FuMA0h_sRNkUI7KfYcJ0tFOcdyeM,6105
|
|
6
6
|
clonebox/detector.py,sha256=4fu04Ty6KC82WkcJZ5UL5TqXpWYE7Kb7R0uJ-9dtbCk,21635
|
|
7
7
|
clonebox/models.py,sha256=Uxz9eHov2epJpNYbl0ejaOX91iMSjqdHskGdC8-smVk,7789
|
|
8
8
|
clonebox/validator.py,sha256=8HV3ahfiLkFDOH4UOmZr7-fGfhKep1Jlw1joJeWSaQE,15858
|
|
9
|
-
clonebox-0.1.
|
|
10
|
-
clonebox-0.1.
|
|
11
|
-
clonebox-0.1.
|
|
12
|
-
clonebox-0.1.
|
|
13
|
-
clonebox-0.1.
|
|
14
|
-
clonebox-0.1.
|
|
9
|
+
clonebox-0.1.18.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
10
|
+
clonebox-0.1.18.dist-info/METADATA,sha256=zdZz4r2QGeCLnFq757o0dR8T9OiLqYneys1r4LFcq58,35220
|
|
11
|
+
clonebox-0.1.18.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
clonebox-0.1.18.dist-info/entry_points.txt,sha256=FES95Vi3btfViLEEoHdb8nikNxTqzaooi9ehZw9ZfWI,47
|
|
13
|
+
clonebox-0.1.18.dist-info/top_level.txt,sha256=LdMo2cvCrEcRGH2M8JgQNVsCoszLV0xug6kx1JnaRjo,9
|
|
14
|
+
clonebox-0.1.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|