You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/walkthrough.md
+96-50Lines changed: 96 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,6 @@ config:
39
39
api:
40
40
port: 8080
41
41
bind_address: "127.0.0.1"
42
-
ssh:
43
-
port: 2222
44
-
bind_address: "0.0.0.0"
45
42
```
46
43
47
44
* `count` - the number of VMs to create - the default is `1` - you can set this to `0` to [create VMs via API instead](/reference/api)
@@ -51,22 +48,7 @@ config:
51
48
* `storage_size` - for storage backends which support it, you can specify the size of the disk
52
49
* `github_user` - your GitHub username, used to fetch your public SSH keys from your profile - additional SSH keys can be added via the [ssh_keys](/reference/ssh) API.
53
50
54
-
The HTTP API is enabled by default and can be disabled with `enabled: false`.
55
-
56
-
The Serial Over SSH (SOS) server is disabled by default and can be enabled by providing a port. Most users will not need the SOS.
57
-
58
-
The default `bind_address` for both the API and SSH is `127.0.0.1` - loopback on the host system.
59
-
60
-
There's no need to provide the HTTP API section unless you plan to run Slicer more than once on the same host, in that case, it's useful to include it so you can change it to a different port on another slicer instance.
61
-
62
-
**Configuration for an Arm64 Slicer installation**
63
-
64
-
`slicer new`will generate a configuration file for the correct image for Arm or x86_64, but if you create one manually, you'll need to edit the `image` field.
The API can bind to a TCP address (secured with an auth token) or a unix socket (secured by OS filesystem permissions). If you run multiple Slicer instances on the same host, give each one a different port or socket path. See the [API reference](/reference/api) for details.
70
52
71
53
The `storage: image` setting means a disk image will be cloned from the root filesystem into a local file. It's not the fastest option for the initial setup, but it's the simplest, persistent and great for long-living VMs.
72
54
@@ -90,6 +72,91 @@ Then, you can connect with SSH:
90
72
ssh ubuntu@192.168.137.2
91
73
```
92
74
75
+
## Quick start with slicer auto
76
+
77
+
If you want to skip the configuration step, use `slicer auto`:
78
+
79
+
```bash
80
+
sudo slicer auto
81
+
```
82
+
83
+
This will:
84
+
85
+
* Auto-detect a free bridge network range from `10.0.0.0/8` that doesn't conflict with your existing interfaces
86
+
* Pick a random API port (so multiple instances don't clash)
87
+
* Import your SSH keys from `~/.ssh/*.pub`
88
+
* Write an `auto.yaml` config in the current directory
89
+
* Start the API server ready for VMs to be launched
90
+
91
+
The API port is printed on startup and written to `auto.yaml` for reference.
Replace `PORT` with the port shown in the `auto.yaml` file or the startup output.
103
+
104
+
### Flags
105
+
106
+
| Flag | Default | Description |
107
+
|---|---|---|
108
+
| `--count` | `0` | Number of VMs to pre-start (0 means API-only, launch with `slicer vm add`) |
109
+
| `--ram` | `4` | RAM in GiB per VM |
110
+
| `--cpu` | `2` | vCPUs per VM |
111
+
| `--isolated` | `false` | Use isolated networking instead of bridge |
112
+
| `--ssh-key` | | SSH public key(s) to add (can be repeated) |
113
+
| `--github` | | GitHub username to import SSH keys from |
114
+
| `--find-ssh-keys` | `true` | Scan `~/.ssh/` for public keys |
115
+
| `--api-port` | auto | Explicit API server port (default: auto-assign free port) |
116
+
| `--api-bind` | `127.0.0.1` | API bind address or unix socket path |
117
+
| `--socket` | `false` | Use a unix socket at `./auto.sock` instead of TCP |
118
+
| `--kernel` | | Path to a custom kernel, or leave blank to extract one from the rootfs |
119
+
120
+
### Examples
121
+
122
+
Pre-start VMs with the daemon instead of launching them separately:
123
+
124
+
```bash
125
+
sudo slicer auto --count=1
126
+
127
+
sudo slicer auto --count=3 --ram=8 --cpu=4
128
+
```
129
+
130
+
SSH keys from `~/.ssh/*.pub` on the host are imported automatically. You can also import keys from a GitHub profile:
131
+
132
+
```bash
133
+
sudo slicer auto --github=alexellis
134
+
```
135
+
136
+
Use isolated networking (no bridge, access VMs via `slicer vm exec` / `slicer vm forward`):
137
+
138
+
```bash
139
+
sudo slicer auto --isolated
140
+
```
141
+
142
+
Use a unix socket instead of TCP for the API:
143
+
144
+
```bash
145
+
sudo slicer auto --socket
146
+
```
147
+
148
+
Set a fixed API port instead of auto-assigning:
149
+
150
+
```bash
151
+
sudo slicer auto --api-port=9090
152
+
```
153
+
154
+
### Re-run behavior
155
+
156
+
On subsequent runs, `sudo slicer auto` reuses the existing `auto.yaml` - including the same port and CIDR. Pass any flag (like `--count=3`) to regenerate it with new settings.
157
+
158
+
The generated `auto.yaml` is a standard Slicer config - you can inspect or edit it to learn the format, then graduate to `slicer new` + `slicer up` for full control over networking, storage, and naming.
159
+
93
160
## Ignore changing SSH host keys
94
161
95
162
If, like the developers of Slicer, you'll be re-creating many hosts with the same IP addresses, you have two options:
@@ -136,46 +203,25 @@ If you want to tail the logs from all available VMs at once, use `fstail` via `a
136
203
sudo -E fstail /var/log/slicer/
137
204
```
138
205
139
-
## Launch a second VM
140
-
141
-
Edit the `count` field, and set it to `2`.
142
-
143
-
Then hit Control + C and launch slicer again.
144
-
145
-
You'll see the second VM come online and can connect to it over SSH.
206
+
## Managing VMs
146
207
147
-
## Enable the HTTP API
208
+
List running VMs:
148
209
149
-
The API is used by the `slicer vm` commands, and can also be used directly via `curl`.
150
-
151
-
```yaml
152
-
api:
153
-
port: 8080
154
-
bind_address: "127.0.0.1:"
155
-
auth:
156
-
enabled: true
210
+
```bash
211
+
slicer vm list
157
212
```
158
213
159
-
The auth token will be created at `/var/lib/slicer/auth/token` and can be used via a `Authorization: Bearer` header.
160
-
161
-
i.e.
214
+
Launch additional VMs without restarting the daemon:
0 commit comments