-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlinux-cli.html
More file actions
735 lines (702 loc) · 34.5 KB
/
linux-cli.html
File metadata and controls
735 lines (702 loc) · 34.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Full Droidspaces Linux CLI reference. Every command, flag, and config option explained.">
<meta name="keywords" content="droidspaces, cli, linux, container, command, line, reference, bind, mount, nat, networking">
<title>Linux CLI - Droidspaces Docs</title>
<meta property="og:title" content="Linux CLI - Droidspaces Docs">
<meta property="og:description" content="Full Droidspaces Linux CLI reference. Every command, flag, and config option explained.">
<meta property="og:url" content="https://www.droidspaces.org/docs/linux-cli.html">
<meta property="og:type" content="website">
<meta property="og:image" content="https://i.ibb.co/d4PLN7Gg/og-image.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Linux CLI - Droidspaces Docs">
<meta name="twitter:description" content="Full Droidspaces Linux CLI reference. Every command, flag, and config option explained.">
<meta name="twitter:image" content="https://i.ibb.co/d4PLN7Gg/og-image.png">
<link rel="canonical" href="https://www.droidspaces.org/docs/linux-cli.html">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
<link rel="stylesheet" href="../style.css">
<style>
.docs-layout {
display: flex; min-height: calc(100vh - 56px);
}
.sidebar {
width: 300px; flex-shrink: 0;
border-right: 1px solid var(--border);
background: var(--bg2);
overflow-y: auto;
position: sticky; top: 56px; height: calc(100vh - 56px);
}
.sidebar-inner {
padding: 0;
position: relative;
width: 100%;
min-width: 0;
}
.sidebar-group {
margin-bottom: 0;
}
.sidebar-heading {
font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.08em;
color: var(--muted); padding: 1rem 1rem 0.25rem;
}
.sidebar-link {
display: block; padding: 0.5rem 1rem;
font-size: 0.9rem; color: var(--muted);
text-decoration: none; border-radius: 0;
transition: all 0.1s;
}
.sidebar-link:hover {
color: var(--text); background: var(--bg3);
}
.sidebar-link.active {
color: var(--accent2); background: rgba(79,142,247,0.08);
font-weight: 600;
}
.sidebar-content {
flex: 1; min-width: 0;
padding: 2rem 2rem 4rem;
max-width: none;
}
.sidebar-content h1 {
font-family: var(--mono); font-size: clamp(1.5rem, 2.5vw, 2rem);
font-weight: 700; letter-spacing: -0.03em; color: var(--text);
margin-bottom: 1.5rem; padding-bottom: 0.75rem;
border-bottom: 1px solid var(--border);
}
.sidebar-content h2 {
font-family: var(--mono); font-size: 1.25rem; font-weight: 700;
color: var(--text); margin: 2rem 0 0.75rem;
letter-spacing: -0.02em;
}
.sidebar-content h2:target {
border-left: 3px solid var(--accent);
padding-left: 0.75rem;
}
.sidebar-content h3 {
font-family: var(--mono); font-size: 1rem; font-weight: 600;
color: var(--accent2); margin: 1.5rem 0 0.5rem;
}
.sidebar-content h3:target {
border-left: 2px solid var(--accent);
padding-left: 0.5rem;
}
.sidebar-content p {
color: var(--muted); line-height: 1.7; margin-bottom: 1rem;
}
.sidebar-content strong { color: var(--text); }
.sidebar-content a {
color: var(--accent2); text-decoration: none;
word-break: break-word; overflow-wrap: anywhere;
}
.sidebar-content a:hover { text-decoration: underline; }
.sidebar-content code {
font-family: var(--mono); font-size: 0.82rem;
background: var(--bg3); padding: 0.15rem 0.4rem;
border-radius: 4px; color: var(--accent2);
word-break: break-word; overflow-wrap: anywhere;
}
.sidebar-content pre {
background: var(--bg2); border: 1px solid var(--border);
border-radius: 8px; padding: 1rem; overflow-x: auto;
margin-bottom: 1rem;
}
.sidebar-content pre code {
background: none; padding: 0; font-size: 0.78rem;
color: var(--text); line-height: 1.6;
}
.code-block {
position: relative;
}
.code-block:hover .copy-btn {
opacity: 1;
}
.copy-btn {
position: absolute; top: 0.5rem; right: 0.5rem;
background: var(--bg3); border: 1px solid var(--border);
color: var(--muted); font-size: 0.7rem;
font-family: var(--sans); padding: 0.2rem 0.5rem;
border-radius: 4px; cursor: pointer;
opacity: 0; transition: opacity 0.15s; z-index: 1;
display: inline-flex; align-items: center; gap: 0.25rem;
}
.copy-btn:hover {
color: var(--accent2); border-color: var(--accent2);
}
@media (max-width: 768px) {
.copy-btn { opacity: 1; }
}
.sidebar-content ul, .sidebar-content ol {
color: var(--muted); line-height: 1.7;
margin-bottom: 1rem; padding-left: 1.25rem;
}
.sidebar-content li { margin-bottom: 0.25rem; }
.sidebar-content li > .code-block { margin-top: 0.5rem; }
.sidebar-content blockquote {
border-left: 3px solid var(--accent); background: var(--bg3);
padding: 0.75rem 1rem; margin-bottom: 1rem;
border-radius: 0 6px 6px 0;
color: var(--text); font-size: 0.9rem;
}
.sidebar-content blockquote p { color: var(--text); margin-bottom: 0; }
.sidebar-content hr {
border: none; border-top: 1px solid var(--border); margin: 2rem 0;
}
.table-wrap {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-bottom: 1.5rem;
}
.table-wrap table {
width: max-content;
min-width: 100%;
margin-bottom: 0;
}
.sidebar-content table {
width: max-content; min-width: 100%;
border-collapse: collapse; font-size: 0.85rem;
margin-bottom: 1.5rem;
}
.sidebar-content th {
font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.06em;
padding: 0.75rem 1rem; text-align: left; color: var(--muted);
border-bottom: 1px solid var(--border); background: var(--bg3);
white-space: nowrap;
}
.sidebar-content td {
padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
color: var(--muted);
white-space: normal; word-break: normal;
overflow-wrap: break-word; max-width: 300px;
}
.sidebar-content img {
max-width: 100%; border-radius: 8px; border: 1px solid var(--border);
margin: 1rem 0;
}
.sidebar-content details {
background: var(--bg2); border: 1px solid var(--border);
border-radius: 8px; padding: 1rem; margin-bottom: 1rem;
}
.sidebar-content summary {
font-family: var(--mono); font-size: 0.85rem;
cursor: pointer; color: var(--accent2);
}
.callout {
border-left: 4px solid var(--accent);
background: var(--bg3); padding: 0.75rem 1rem;
margin-bottom: 1rem; border-radius: 0 6px 6px 0;
font-size: 0.9rem; color: var(--text);
}
.callout-title {
font-family: var(--mono); font-size: 0.72rem;
text-transform: uppercase; letter-spacing: 0.06em;
display: block; margin-bottom: 0.25rem;
}
.callout-note { border-left-color: var(--accent); }
.callout-note .callout-title { color: var(--accent); }
.callout-tip { border-left-color: var(--green); }
.callout-tip .callout-title { color: var(--green); }
.callout-warning { border-left-color: #f59e0b; }
.callout-warning .callout-title { color: #f59e0b; }
.callout-caution { border-left-color: #f59e0b; }
.callout-caution .callout-title { color: #f59e0b; }
.callout-important { border-left-color: #ef4444; }
.callout-important .callout-title { color: #ef4444; }
.doc-nav-buttons {
display: flex; justify-content: space-between; gap: 1rem;
margin: 2rem 0 1rem;
}
.doc-nav-btn {
padding: 0.5rem 1rem; border-radius: 8px;
font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
text-decoration: none; color: var(--muted);
border: 1px solid var(--border);
transition: all 0.15s; max-width: 50%;
}
.doc-nav-btn:hover {
color: var(--text); border-color: var(--muted);
}
.doc-nav-next {
margin-left: auto; text-align: right;
}
.doc-nav-prev {
text-align: left;
}
.doc-copyright {
font-size: 0.78rem; color: var(--border2);
padding-top: 1rem; border-top: 1px solid var(--border);
margin-top: 1.5rem; text-align: center;
}
.doc-copyright a {
color: var(--border2); text-decoration: none;
}
.doc-copyright a:hover {
color: var(--muted);
}
.nav-overlay {
display: none; position: fixed;
top: 56px; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.5); z-index: 199;
}
.nav-overlay.active { display: block; }
.sidebar-close {
display: none;
position: absolute; top: 0.5rem; right: 1rem;
background: none; border: none;
color: var(--muted); font-size: 1.5rem;
cursor: pointer; padding: 0.25rem 0.5rem;
line-height: 1; border-radius: 4px;
}
.sidebar-close:hover {
color: var(--text); background: var(--bg3);
}
.doc-breadcrumb {
display: none;
position: sticky;
top: 56px;
z-index: 50;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: var(--bg2);
border-bottom: 1px solid var(--border);
font-size: 0.78rem;
color: var(--muted);
user-select: none;
cursor: pointer;
}
.doc-breadcrumb .bc-sep {
color: var(--border2);
}
.doc-breadcrumb .bc-section {
color: var(--text);
}
.doc-breadcrumb .bc-label {
color: var(--accent2);
}
@media (max-width: 768px) {
.sidebar {
display: flex;
position: fixed; top: 56px; left: 0;
width: 300px; height: calc(100dvh - 56px); z-index: 200;
border-right: 1px solid var(--border);
transform: translateX(-100%);
transition: transform 0.25s ease;
box-shadow: 4px 0 12px rgba(0,0,0,0.2);
}
.sidebar.open { transform: translateX(0); }
.sidebar-close { display: block; }
.sidebar-content { padding: 1.5rem 1rem 3rem; }
.doc-breadcrumb { display: flex; }
.docs-layout { flex-direction: column; }
.sidebar-content th,
.sidebar-content td {
padding: 0.5rem 0.5rem;
font-size: 0.78rem;
}
}
</style>
<script>
(function () {
const savedTheme = localStorage.getItem('theme');
if (savedTheme) document.documentElement.setAttribute('data-theme', savedTheme);
})();
</script>
</head>
<body>
<nav aria-label="Main navigation">
<div class="container" style="display:flex;align-items:center;justify-content:space-between;height:100%;">
<a href="/" class="nav-logo">
<svg class="logo-icon" viewBox="8.25 10.35 31.5 27.3" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M36.85 30.16H11.15c-0.82 0-1.48 0.68-1.48 1.52v3.05c0 0.84 0.66 1.52 1.48 1.52h25.69c0.82 0 1.48-0.68 1.48-1.52v-3.05c0-0.84-0.66-1.52-1.48-1.52ZM12.58 34.97c-0.95 0-1.73-0.79-1.73-1.77s0.77-1.77 1.73-1.77 1.73 0.79 1.73 1.77-0.77 1.77-1.73 1.77Z"/>
<path d="M36.85 21.00H11.15c-0.82 0-1.48 0.68-1.48 1.52v3.05c0 0.84 0.66 1.52 1.48 1.52h25.69c0.82 0 1.48-0.68 1.48-1.52v-3.05c0-0.84-0.66-1.52-1.48-1.52ZM12.58 25.82c-0.95 0-1.73-0.79-1.73-1.77s0.77-1.77 1.73-1.77 1.73 0.79 1.73 1.77-0.77 1.77-1.73 1.77Z"/>
<path d="M36.84 11.74H11.15c-0.82 0-1.48 0.68-1.48 1.52v3.05c0 0.84 0.66 1.52 1.48 1.52h25.69c0.82 0 1.48-0.68 1.48-1.52v-3.05c0-0.84-0.66-1.52-1.48-1.52ZM12.58 16.57c-0.95 0-1.73-0.79-1.73-1.77s0.77-1.77 1.73-1.77 1.73 0.79 1.73 1.77-0.77 1.77-1.73 1.77Z"/>
</svg>
<span class="logo-text">Droidspaces</span>
</a>
<div style="display:flex;align-items:center;gap:0.5rem;">
<ul class="nav-links">
<li class="nav-features"><a href="/#features">Features</a></li>
<li><a href="/docs/" style="color:var(--accent2)"><i class="fas fa-book nav-icon nav-icon-docs"></i><span class="nav-label">Documentation</span></a></li>
<li class="nav-downloads"><a href="/downloads.html"><i class="fas fa-download nav-icon nav-icon-docs"></i><span class="nav-label">Downloads</span></a></li>
<li><a href="https://github.com/ravindu644/Droidspaces-OSS" rel="noopener noreferrer"><i class="fab fa-github nav-icon"></i><span class="nav-label nav-label-gt">GitHub</span></a></li>
<li><a href="https://t.me/Droidspaces" rel="noopener noreferrer"><i class="fab fa-telegram nav-icon"></i><span class="nav-label nav-label-gt">Telegram</span></a></li>
</ul>
<button class="theme-toggle" id="theme-toggle" title="Toggle theme">
<svg class="sun-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display:none">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
<svg class="moon-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg>
</button>
</div>
</div>
</nav>
<div class="nav-overlay" id="sidebar-overlay"></div>
<div class="doc-breadcrumb" id="sidebar-toggle" role="button" tabindex="0" aria-label="Toggle docs navigation">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" style="flex-shrink:0">
<rect x="3" y="3" width="18" height="18" rx="2"/>
<line x1="9" y1="3" x2="9" y2="21"/>
</svg>
<span>Docs</span><span class="bc-sep">/</span><span class="bc-section">Guides</span><span class="bc-sep">/</span><span class="bc-label">Linux CLI</span>
</div>
<div class="docs-layout">
<aside class="sidebar" id="sidebar">
<div class="sidebar-inner">
<button class="sidebar-close" id="sidebar-close" aria-label="Close sidebar">×</button>
<div class="sidebar-group">
<div class="sidebar-heading">Basics</div>
<a href="installation-android.html" class="sidebar-link">Android Installation</a>
<a href="installation-linux.html" class="sidebar-link">Linux Installation</a>
</div>
<div class="sidebar-group">
<div class="sidebar-heading">Guides</div>
<a href="features.html" class="sidebar-link">Feature Deep Dives</a>
<a href="gpu-acceleration.html" class="sidebar-link">GPU Acceleration</a>
<a href="kernel-configuration.html" class="sidebar-link">Kernel Configuration</a>
<a href="usage-android-app.html" class="sidebar-link">Android App Usage</a>
<a href="linux-cli.html" class="sidebar-link active">Linux CLI</a>
</div>
<div class="sidebar-group">
<div class="sidebar-heading">Recipes</div>
<a href="cool-things-you-can-do.html" class="sidebar-link">Cool Things You Can Do</a>
</div>
<div class="sidebar-group">
<div class="sidebar-heading">Reference</div>
<a href="troubleshooting.html" class="sidebar-link">Troubleshooting</a>
<a href="community-supported-devices.html" class="sidebar-link">Community-Supported Devices</a>
<a href="nix-nixos.html" class="sidebar-link">Nix/NixOS</a>
<a href="uninstallation.html" class="sidebar-link">Uninstallation</a>
</div>
</div>
</aside>
<div class="sidebar-content">
<h1 id="linux-cli-guide">Linux CLI Guide</h1>
<p>Complete guide to using Droidspaces from the command line on Linux.</p>
<div class="callout callout-tip"><strong class="callout-title">TIP</strong> <strong>Using the CLI on Android:</strong> All command-line arguments work exactly the same on Android.
Once the backend is installed via the app, the <code>droidspaces</code> binary is located at <code>/data/local/Droidspaces/bin/droidspaces</code>.
Also, you can view the full interactive, <strong>more advanced</strong> command-line documentation offline at any time by running:
<code>droidspaces docs</code></div>
<hr>
<h2 id="quick-navigation">Quick Navigation</h2>
<p><a href="#getting-started" rel="noopener noreferrer">1. Getting Started</a><br> <a href="#command-reference" rel="noopener noreferrer">2. Command Reference</a><br> <a href="#options-flags" rel="noopener noreferrer">3. Options & Flags</a><br> <a href="#configs" rel="noopener noreferrer">4. Configuration Files</a><br> <a href="#common-workflows" rel="noopener noreferrer">5. Common Workflows</a><br> <a href="#advanced-usage" rel="noopener noreferrer">6. Advanced Usage & Lifecycle</a><br> <a href="#system-requirements" rel="noopener noreferrer">7. System Requirements</a></p>
<hr>
<h2 id="getting-started">1. Getting Started</h2>
<h3 id="start-your-first-container">Start Your First Container</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code># From a rootfs directory
sudo droidspaces --rootfs=/path/to/rootfs start
# From an ext4 image
sudo droidspaces --name=mycontainer --rootfs-img=/path/to/rootfs.img start
</code></pre></div>
<h3 id="enter-the-container">Enter the Container</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code># Enter as root
sudo droidspaces --name=mycontainer enter
# Enter as a specific user
sudo droidspaces --name=mycontainer enter username
</code></pre></div>
<h3 id="stop-the-container">Stop the Container</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code># Stop a single container
sudo droidspaces --name=mycontainer stop
# Stop multiple containers
sudo droidspaces --name=web,db,app stop
</code></pre></div>
<hr>
<h2 id="command-reference">2. Command Reference</h2>
<div class="table-wrap"><table>
<thead>
<tr><th>Command</th><th>Action</th></tr>
</thead>
<tbody>
<tr><td><code>start</code></td><td>Start a new container. Requires either <code>--rootfs</code> or <code>--rootfs-img</code>.</td></tr>
<tr><td><code>stop</code></td><td>Gracefully shut down one or more containers.</td></tr>
<tr><td><code>restart</code></td><td>Fast restart (under 200ms) by preserving loop mounts.</td></tr>
<tr><td><code>enter [user]</code></td><td>Open an interactive shell inside a running container.</td></tr>
<tr><td><code>run <cmd></code></td><td>Execute a single command without opening a full shell. Use <code>-u</code>/<code>--user</code> to run as a specific container user.</td></tr>
<tr><td><code>info</code></td><td>Show deep technical details about a container.</td></tr>
<tr><td><code>show</code></td><td>List all currently running containers in a table.</td></tr>
<tr><td><code>scan</code></td><td>Detect and register orphaned/untracked containers.</td></tr>
<tr><td><code>check</code></td><td>Verify system and kernel requirements.</td></tr>
<tr><td><code>docs</code></td><td>Open the interactive terminal-based documentation.</td></tr>
<tr><td><code>help</code></td><td>Display the help message.</td></tr>
<tr><td><code>version</code></td><td>Print the version string.</td></tr>
</tbody>
</table></div>
<hr>
<h2 id="options-flags">3. Options & Flags</h2>
<h3 id="rootfs-selection">Rootfs Selection</h3>
<div class="table-wrap"><table>
<thead>
<tr><th>Option</th><th>Short</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>--rootfs=PATH</code></td><td><code>-r</code></td><td>Path to a rootfs directory. Must contain <code>/sbin/init</code>.</td></tr>
<tr><td><code>--rootfs-img=PATH</code></td><td><code>-i</code></td><td>Path to an ext4 rootfs image file or block device. Automatically mounted.</td></tr>
</tbody>
</table></div>
<p><em>Note: These are mutually exclusive. <code>--name</code> is mandatory when using <code>--rootfs-img</code>.</em></p>
<h3 id="container-identity-configuration">Container Identity & Configuration</h3>
<div class="table-wrap"><table>
<thead>
<tr><th>Option</th><th>Short</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>--name=NAME</code></td><td><code>-n</code></td><td>Unique name for the container. Auto-generated if omitted in directory-based rootfs mode.</td></tr>
<tr><td><code>--hostname=NAME</code></td><td><code>-h</code></td><td>Set the container's hostname. Defaults to the container name.</td></tr>
<tr><td><code>--conf=PATH</code></td><td><code>-C</code></td><td>Load container configuration directly from a config file.</td></tr>
<tr><td><code>--reset</code></td><td></td><td>Reset container config to defaults (preserves name, rootfs path).</td></tr>
</tbody>
</table></div>
<h3 id="networking">Networking</h3>
<div class="table-wrap"><table>
<thead>
<tr><th>Option</th><th>Short</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>--net=MODE</code></td><td></td><td>Networking mode: <code>host</code> (default), <code>nat</code>, or <code>none</code>.</td></tr>
<tr><td><code>--upstream IFACE[,..]</code></td><td></td><td>Upstream internet interface(s) for NAT mode (e.g., <code>wlan0,rmnet0</code>). Wildcards are supported (e.g., <code>rmnet*</code>, <code>v4-rmnet_data*</code>). <strong>Mandatory for NAT</strong>.</td></tr>
<tr><td><code>--port HOST:CONT[/proto]</code></td><td></td><td>Forward host port to container (NAT mode). Supports TCP/UDP.</td></tr>
<tr><td><code>--dns=SERVERS</code></td><td><code>-d</code></td><td>Custom DNS servers, comma-separated. Example: <code>--dns=1.1.1.1,8.8.8.8</code></td></tr>
<tr><td><code>--disable-ipv6</code></td><td></td><td>Disable IPv6 networking support (Host mode only).</td></tr>
</tbody>
</table></div>
<h3 id="feature-flags">Feature Flags</h3>
<div class="table-wrap"><table>
<thead>
<tr><th>Option</th><th>Short</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>--foreground</code></td><td><code>-f</code></td><td>Attach to the container console on start to see init logs.</td></tr>
<tr><td><code>--volatile</code></td><td><code>-V</code></td><td>Ephemeral mode. Changes are stored in RAM and lost on exit.</td></tr>
<tr><td><code>--hw-access</code></td><td><code>-H</code></td><td>Expose host hardware (GPU, USB, etc.). Auto-detects GPU group IDs and creates matching groups inside the container. Mounts X11 socket for GUI apps (Termux X11 on Android, <code>/tmp/.X11-unix</code> on Linux). See <a href="features.html#hardware-access-mode" rel="noopener noreferrer">Safety Warning</a>.</td></tr>
<tr><td><code>--gpu</code></td><td></td><td>Exclusively enable GPU acceleration. Scans the host <code>/dev</code> for known GPU nodes and securely maps only them into the container without exposing other host hardware. (Ignored if <code>-H</code> is passed).</td></tr>
<tr><td><code>--termux-x11</code></td><td><code>-X</code></td><td>Mount X11 socket for Termux-X11 display (Android only).</td></tr>
<tr><td><code>--enable-android-storage</code></td><td></td><td>Mount <code>/storage/emulated/0</code> (Android only).</td></tr>
<tr><td><code>--selinux-permissive</code></td><td></td><td>Set host SELinux to permissive for the container session.</td></tr>
<tr><td><code>--force-cgroupv1</code></td><td></td><td>Force legacy Cgroup V1 hierarchy. Required if the host kernel has a broken or partial Cgroups V2 implementation (common on older Android 4.x kernels).</td></tr>
<tr><td><code>--privileged=TAGS</code></td><td></td><td>Relax security protections. Accepts a comma-separated list of tags: <code>nomask</code>, <code>nocaps</code>, <code>noseccomp</code>, <code>shared</code>, <code>unfiltered-dev</code>, <code>full</code>. Use with extreme caution.</td></tr>
</tbody>
</table></div>
<h3 id="bind-mounts">Bind Mounts</h3>
<div class="table-wrap"><table>
<thead>
<tr><th>Option</th><th>Short</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>--bind-mount=S:D</code></td><td><code>-B</code></td><td>Mount a host directory <code>S</code> to container path <code>D</code>.</td></tr>
</tbody>
</table></div>
<p><strong>Formats:</strong> - Multiple mounts: <code>-B /src1:/dst1,/src2:/dst2</code> or <code>-B /src1:/dst1 -B /src2:/dst2</code> - Max limits: Up to 16 mounts per container. - Missing host paths are skipped with a warning.</p>
<hr>
<h2 id="configs">4. Configuration Files</h2>
<p>Instead of relying solely on long command-line arguments, Droidspaces allows you to define container environments in a <code>.config</code> file and load it using the <code>--conf</code> flag.</p>
<p>Below is a reference of every supported key in the configuration file:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code># Droidspaces Container Configuration
# Generated automatically - Changes may be overwritten
# Unique identifier for the container
name=ubuntu
# Hostname of the container environment
hostname=ubuntu-devbox
# Absolute path to the rootfs directory or .img file
rootfs_path=/home/user/ubuntu-24.04-rootfs.img
# Custom path to store the container's PID file
pidfile=/var/lib/Droidspaces/Pids/ubuntu.pid
# Comma-separated list of host directories to bind mount (src:dest)
bind_mounts=/home/user:/mnt/host,/tmp:/mnt/tmp
# Absolute path to a file containing environment variables to load
env_file=/path/to/env.list
# Unique UUID (Automatically generated, do not change manually)
uuid=d88107dab4ef48a8874a93897188982d
# Custom DNS servers (comma separated)
dns_servers=1.1.1.1,8.8.8.8
# -------- Boolean Flags (0 or 1) --------
# Disable IPv6 networking
disable_ipv6=0
# Expose host hardware nodes to the container (/dev)
enable_hw_access=0
# Auto-detect and securely map GPU nodes without full hardware access
enable_gpu_mode=0
# Android: Setup Termux X11 socket
enable_termux_x11=0
# Android: Setup Android internal shared storage mount
enable_android_storage=0
# Set the host SELinux policy to permissive during boot
selinux_permissive=0
# Ephemeral mode: changes are lost on exit
volatile_mode=1
# Run the container in the foreground instead of forking
foreground=0
# ----------------------------------------
# Android App Configuration
# Any lines that the CLI engine does not recognize will be safely
# preserved at the bottom of the config file and passed back to the Host.
</code></pre></div>
<hr>
<h2 id="common-workflows">5. Common Workflows</h2>
<h3 id="running-with-a-config-file">Running with a Config File</h3>
<p>Instead of passing many flags, you can load everything from a <code>.config</code> file:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces --conf=./my-container.config start
</code></pre></div>
<h3 id="persistent-development">Persistent Development</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces \
--name=dev \
--rootfs=/path/to/ubuntu-rootfs \
--hostname=devbox \
--bind-mount=/home/user/projects:/workspace \
start
</code></pre></div>
<h3 id="nat-isolation-with-port-forwarding">NAT Isolation with Port Forwarding</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces \
--name=server \
--rootfs-img=/path/to/rootfs.img \
--net=nat \
--upstream=wlan0,rmnet0 \
--port=8080:80 \
start
</code></pre></div>
<h3 id="ephemeral-testing">Ephemeral Testing</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces --name=test --rootfs=/path/to/rootfs --volatile start
</code></pre></div>
<h3 id="one-off-commands">One-Off Commands</h3>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces --name=mycontainer run uname -a
# Use sh -c for pipes:
sudo droidspaces --name=mycontainer run sh -c "ps aux | grep init"
# Run as a specific user with -u/--user:
sudo droidspaces --name=mycontainer -u myuser run whoami
sudo droidspaces --name=mycontainer -u myuser run env
sudo droidspaces --name=mycontainer -u myuser run sh -c "id && env"
</code></pre></div>
<h3 id="gpu-acceleration">GPU Acceleration</h3>
<p>Ensure only the GPU nodes (and not all host hardware) are securely exposed:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces --name=gpu-app --rootfs=/path/to/rootfs --gpu start
</code></pre></div>
<h3 id="deep-customization-privileged-mode">Deep Customization (Privileged Mode)</h3>
<p>For cases where you need unmasked access:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces --name=privileged-box --rootfs=/path/to/rootfs --privileged=full start
# Or mix and match tags:
sudo droidspaces --name=dev-box --rootfs=/path/to/rootfs --privileged=nocaps,noseccomp start
</code></pre></div>
<hr>
<h2 id="advanced-usage">6. Advanced Usage & Lifecycle</h2>
<h3 id="container-recovery">Container Recovery</h3>
<p>If a container was started outside the current session, or its host-side PID file / config file was lost or corrupted, use <code>scan</code> to resurrect it from the container's isolated <code>/run</code> memory:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces scan
</code></pre></div>
<hr>
<h2 id="system-requirements">7. System Requirements</h2>
<p>Always run the built-in checker to verify your kernel supports the required namespaces and features:</p>
<div class="code-block"><button class="copy-btn" onclick="copyCode(this)"><i class="fa-regular fa-copy"></i> Copy</button><pre><code>sudo droidspaces check
</code></pre></div>
<p>See the <a href="kernel-configuration.html" rel="noopener noreferrer">Kernel Configuration Guide</a> for a deep dive into technical requirements.</p>
<hr>
<h2 id="next-steps">Next Steps</h2>
<ul>
<li><a href="features.html" rel="noopener noreferrer">Feature Deep Dives</a>
</li>
<li><a href="troubleshooting.html" rel="noopener noreferrer">Troubleshooting</a>
</li>
<li><a href="usage-android-app.html" rel="noopener noreferrer">Android App Usage Guide</a>
</li>
</ul>
<div class="doc-nav-buttons"><a href="usage-android-app.html" class="doc-nav-btn doc-nav-prev">← Android App Usage</a><a href="cool-things-you-can-do.html" class="doc-nav-btn doc-nav-next">Cool Things You Can Do →</a></div>
<p class="doc-copyright">© 2026 Droidspaces · <a href="https://github.com/ravindu644/Droidspaces-OSS/blob/main/LICENSE" rel="noopener noreferrer">GPLv3</a> · by <a href="https://github.com/ravindu644" rel="noopener noreferrer">ravindu644</a> and <a href="https://github.com/ravindu644/Droidspaces-OSS/graphs/contributors" rel="noopener noreferrer">contributors</a>
</p>
</div>
</div>
<script>
(() => {
const themeToggle = document.getElementById('theme-toggle');
const sunIcon = themeToggle.querySelector('.sun-icon');
const moonIcon = themeToggle.querySelector('.moon-icon');
const mediaQuery = window.matchMedia('(prefers-color-scheme: light)');
function updateIcons(theme) {
sunIcon.style.display = theme === 'light' ? 'none' : 'block';
moonIcon.style.display = theme === 'light' ? 'block' : 'none';
}
function getEffectiveTheme() {
const saved = localStorage.getItem('theme');
if (saved) return saved;
return mediaQuery.matches ? 'light' : 'dark';
}
function applyTheme(theme) {
if (theme === 'system') {
document.documentElement.removeAttribute('data-theme');
updateIcons(mediaQuery.matches ? 'light' : 'dark');
} else {
document.documentElement.setAttribute('data-theme', theme);
updateIcons(theme);
}
}
applyTheme(getEffectiveTheme());
mediaQuery.addEventListener('change', (e) => {
if (!localStorage.getItem('theme')) applyTheme(e.matches ? 'light' : 'dark');
});
themeToggle.addEventListener('click', () => {
const currentTheme = getEffectiveTheme();
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
localStorage.setItem('theme', newTheme);
applyTheme(newTheme);
});
// Docs sidebar toggle
const sidebarToggle = document.getElementById('sidebar-toggle');
const sidebar = document.getElementById('sidebar');
const sidebarOverlay = document.getElementById('sidebar-overlay');
function openSidebar() {
sidebar.classList.add('open');
sidebarOverlay.classList.add('active');
document.body.style.overflow = 'hidden';
}
function closeSidebar() {
sidebar.classList.remove('open');
sidebarOverlay.classList.remove('active');
document.body.style.overflow = '';
}
if (sidebarToggle) {
sidebarToggle.addEventListener('click', (e) => {
e.stopPropagation();
if (sidebar.classList.contains('open')) closeSidebar();
else openSidebar();
});
}
if (sidebarOverlay) {
sidebarOverlay.addEventListener('click', closeSidebar);
}
const sidebarClose = document.getElementById('sidebar-close');
if (sidebarClose) {
sidebarClose.addEventListener('click', closeSidebar);
}
if (sidebar) {
sidebar.querySelectorAll('a').forEach(link => {
link.addEventListener('click', closeSidebar);
});
}
})();
function copyCode(btn) {
const code = btn.parentElement.querySelector('pre code');
const text = code.textContent;
navigator.clipboard.writeText(text).then(() => {
const orig = btn.innerHTML;
btn.innerHTML = '<i class="fas fa-check"></i> Copied!';
setTimeout(() => { btn.innerHTML = orig; }, 1500);
}).catch(() => {});
}
</script>
</body>
</html>