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
|
#+title: My feed
#+OPTIONS: num:nil toc:1
#+HTML_HEAD_EXTRA: <style>*{font-family: sans-serif !important}</style>
#+ATTR_HTML: :rules all :frame border :align center
| [[https://skylarcloud.xyz][🏠 Home]] | [[https://skylarcloud.xyz/feed.html][📰 My feed]] | [[https://searx.skylarcloud.xyz][🔭 SearXNG]] | [[https://git.skylarcloud.xyz][⚙️ Git Repos]] |
* Prepping for v2 of my salt repo :note:
:PROPERTIES:
:ID: 04b2c85d-8339-46b5-a123-180ed526bb25
:PUBDATE: 2025-04-02 Wed 22:34
:END:
I've massively restructured my salt repo and added enough features that I'm going to make a new repository and release it again in full, as a 2.0 version. This should be done within the next week or two.
* Methods of installing software in QubesOS with Saltstack :post:
:PROPERTIES:
:ID: bb15d59f-c217-441a-9446-108429b52c10
:PUBDATE: 2025-04-02 Wed 22:34
:END:
Here are some various methods of installing software that I've used in my personal salt configuration
** pkg.installed
:PROPERTIES:
:ID: 0e128288-8e86-41b1-9d4e-8ed5d431d110
:END:
Here's ~/srv/user_salt/pkgs/accounting.sls~ as an example. It uses the simplest way of installing programs, which is just listing them under ~pkg.installed~ which pulls them from your distros main repositories. This is the most preferable way to install software if it's available.
#+begin_src salt
# Install accounting tools
accounting--install-apps:
pkg.installed:
- pkgs:
- hledger # Command-line plain text accounting
- gnucash # Graphical GNU accounting suite
#+end_src
** move a binary file into /usr/bin
:PROPERTIES:
:ID: 0dacbd16-7ddd-420e-8422-acff908a3c46
:END:
Here's ~/srv/user_salt/pkgs/st.sls~ as an example. It takes a binary file that's part of this salt repository, and moves it into the ~/usr/bin/ directory in a qube.
#+begin_src salt
# Installs my build of st terminal
/usr/bin/st:
file.managed:
- source: salt://pkgs/bin/st.bin
- user: root
- group: root
- mode: 777
#+end_src
** Install from third-party repo with a script
:PROPERTIES:
:ID: 98e7e2ec-b88b-4a92-a065-5876a4f7c0ed
:END:
Here's ~/srv/user_salt/pkgs/signal.sls~ as an example. It starts by installing some dependencies using the most common ~pkg.installed~ method, then moves an install script ~/srv/user_salt/pkgs/install-scripts/signal-repo.sh~ into a qube and executes it to install the Signal messenger.
#+begin_src salt
...
signal--repo-script:
file.managed: # file.managed lets you place files from your salt repo into qubes
- name: /usr/bin/install-repo # this is where the installation script is placed
- source: salt://pkgs/install-scripts/signal-repo.sh # This is where the installation script was sourced
- user: root # sets the owner of the file, you can usually default to root
- group: root # sets the group of the file, you can usually default to root
- mode: 777 # sets the permissions of the file, you can usually default to 777 (any user on the qube has permissions)
# This simply executes the install-repo script in a qube
'install-repo':
cmd.run
#+end_src
Here's the installation script that's ran:
*** ~/srv/user_salt/pkgs/install-scripts/signal-repo.sh~
:PROPERTIES:
:ID: f07d4cd1-6ec6-41da-af32-41b9512eefb9
:END:
#+begin_src bash
# Retrieves Signal's key for verifying the package
# The request is proxied through 127.0.0.1:8082 to allow the template qube to access the internet
sudo curl --proxy 127.0.0.1:8082 -s https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor | sudo tee -a /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
# Defines Signal's repo in /etc/apt/sources.list.d/
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | tee /etc/apt/sources.list.d/signal-xenial.list
# Updates packages and installs signal-desktop through the newly configured repository
sudo apt update
sudo apt install signal-desktop -y
#+end_src
* Website update :note:
:PROPERTIES:
:ID: c843faa8-1fce-478d-bab2-e016c75bf59d
:PUBDATE: 2025-03-01 Sat 10:14
:END:
I've changed a few things about the website:
The blog posts have been consolidated into a single org document. I like the feeling of having one large waterfall of writing, with a level-one table of contents to navigate the posts.
I've figured out how to create an RSS feed using ~ox-rss~, which makes it easy to generate an xml feed from the newly-consolidated feed.org document. You can now follow my feed from any RSS reader!
https://git.skylarcloud.xyz now has a repo with the org and html files used for this site.
* Convenient torrenting with qBittorrent :post:
:PROPERTIES:
:ID: a3fa9387-fbfd-41dd-9def-a4588c04bc73
:PUBDATE: 2025-02-28 Fri 14:30
:END:
** Introduction
:PROPERTIES:
:ID: cf684caf-eab2-489a-aa19-d0d1bd066d42
:END:
Your access to media should not be limited by money, nor should it be limited by technical ability. I want to demonstrate with this quick guide that torrenting is as accessible and easy as it's ever been, using Free and open-source software.
** Install qBittorrent
:PROPERTIES:
:ID: 3044ceeb-02e4-4564-a3cc-aa45fae23d41
:END:
qBittorrent is a Free and open-source BitTorrent client that supports tons of features, but you need to know much at all to get started. To install it, go to their downloads page website at https://www.qbittorrent.org/download and select the right option for your computer. It supports Windows, MacOS, and can be installed through most common package managers on Linux.
After it's downloaded, install it like you would with any other program.
** Enable the search engine
:PROPERTIES:
:ID: fbfaded9-a520-4235-b31f-e902d0941daf
:END:
To let us search for media, we need to turn on qBittorrent's search engine.
- Click the "View" button in the toolbar
- Check the "Search Engine" box
There should now be a "Search" tab next to "Transfers" under the toolbar
- Click the "Search" tab
- Click "Search Plugins" at the bottom right
- Click "Check for updates"
- Click "Ok" and "Close" to exit the search plugins menu
** Search for and download some media
:PROPERTIES:
:ID: 46c62a55-9791-481d-a1f3-73a171f80851
:END:
- In the "Search" tab, click on the search bar, enter the name of some movie, and press Return. Very quickly, you should see many results, with slightly different titles, sizes, and numbers of "Seeders", among other things.
"Seeders" refers to the computers that are hosting the media you want. In general, you want to download files being seeded by lots of computers to get the fastest download speeds possible
- Pick a result with a name indicating the media, resolution, and episodes/seasons you want. Double-click it
- A download prompt will appear. It has lots of settings, but you can simply click "Ok" to download it normally.
** Now just wait
:PROPERTIES:
:ID: 2a6bbad6-a1d6-4de8-ad8a-0de0a2747918
:END:
You can track the progress of torrents being downloaded in the "Transfers" tab. When it's 100% complete, you can right-click the file, and click "Preview file" to have it play in your default media player.
If you're feeling charitable, you can leave qBittorrent running in the background to seed the files for other users. It'll help keep the media accessible for everyone, and improve download speeds for others. Using a VPN is recommended if you plan on leaving the client running for long periods of time.
** Extra tips
:PROPERTIES:
:ID: 7bf124fd-ae71-4f21-b4e2-721ce20898ce
:END:
*** Consider using a VPN
:PROPERTIES:
:ID: c85d4e5c-94cb-4299-a2e7-70dd16b59401
:END:
Some copyright holders use bots to detects users downloading their media. If you're not using a VPN, these companies can see your IP and potentially send complaints to your ISP. If you download many things and want to keep your ISP happy, using a VPN will ensure your torrenting can't be traced to your IP address. I personally use and recommend Mullvad ($5/month for 5 devices), but there are other reputable ones like Proton and IVPN.
*** Stream Media
:PROPERTIES:
:ID: 2609a1ba-d7a9-45ce-8233-1fb8b6743691
:END:
When you go to download a torrent and the download prompt pops up, you can optionally select "Download first and last pieces first" and "Download in sequential order".
This will likely make the total download take longer, but by downloading it in order, you can stream it in real time. Wait until about 5% of the download is complete, then you can watch it while the rest downloads live in the background.
*** Hosting a media server with Jellyfin
:PROPERTIES:
:ID: 3f543081-e392-43b9-bd6f-194624ae90f5
:END:
Jellyfin is a Free and open-source media-hosting server you can run on your computer. It'll let you sign in to your library on a smart TV, other devices on your local network, or in a browser.
Setting it up is outside the scope of this post, but I highly recommend it. It basically just consists of downloading the server, configuring your libraries, installing the clients on your other devices, and logging in to your server.
https://jellyfin.org/
* QubesOS Saltstack configuration v1 :post:
:PROPERTIES:
:ID: 9abfb972-27d0-4f05-b55d-05e4398934ec
:PUBDATE: 2025-02-28 Fri 14:30
:END:
** Notice:
:PROPERTIES:
:ID: 45c1d704-fcb1-4649-ab5d-ab886aa9e911
:END:
*The repository is now hosted on this site at https://git.skylarcloud.xyz, not Github! For up-to-date instructions, refer to the new README.org in the new repo, there have been lots of changes since the publishing of this post.*
** Intro
:PROPERTIES:
:ID: 73391422-9bbd-4c1d-813c-31c5daeb587f
:END:
I'm publishing the janky V1 of my QubesOS configuration written with Saltstack. It'll help set up a window manager, a couple of handy qubes, Doom Emacs, and the 3isec repo to jump-start your QubesOS experience.
It's not new-user friendly yet, nor is it in a state where anyone can immediately download and apply it. At the very least you'll need to change the references to my username to yours in the salt files, and make sure the Fedora-40-XFCE and the Debian-12-minimal template are installed on your system.
You can use my configuration almost as-is (just change the username references!) and it does work, but it's not very feature-filled or optimized, and it's probable that the next versions will conflict with it.
*** Link to repo on Github
:PROPERTIES:
:ID: fd5357f6-8310-46ba-a812-43083d60454f
:END:
+https://github.com/bumbleoats/My-QubesOS-Configuration+ <- See the notice at the top of this post
*** Installation
:PROPERTIES:
:ID: 5e78d85f-11da-46a3-a7ea-9240922cf2bd
:END:
Make sure ~state.user-dirs~ is active, then just move the repo to ~/srv/user_salt/~ in dom0, and apply with ~sudo qubesctl --all state.apply~
**** Resources for installation
:PROPERTIES:
:ID: ba3b1d01-250b-445d-9149-0e21df840e55
:END:
***** Community user guide for user-salt
:PROPERTIES:
:ID: a5a190bb-c473-4a8f-90bb-dc5cb65b5088
:END:
- https://forum.qubes-os.org/t/qubes-salt-beginners-guide/20126
- This was the best resource I found as a beginner, I wasn't able to get anything working until I stumbled on it
***** Issue I sometimes run into from a fresh QubesOS install
:PROPERTIES:
:ID: cfbddb1d-812f-42c4-8d46-4416e235321e
:END:
- https://github.com/QubesOS/qubes-issues/issues/8491
- TL;DR: This is the solution that's worked for me, pulled from the discussion:
#+begin_src bash
ln -s /srv/salt/qubes/user-dirs.top /srv/salt/_tops/base/user-dirs.top
#+end_src
** Programs in dom0
:PROPERTIES:
:ID: c227f54d-d582-4b34-8873-de37bdd2c133
:END:
My configuration will install a few programs in dom0. It's important that I put this at the top because generally, you want to limit the number of packages in dom0. Every new package is more attack surface on your most critical qube. I trust the programs I've chosen to add, and by using my configuration, you're implicitly trusting them too.
Look in ~/srv/user_salt/~ to find the related salt files and see the installed programs.
** Window Management
:PROPERTIES:
:ID: a0946e49-a6bf-4eb9-b17f-35bf00909f0f
:END:
*** i3
:PROPERTIES:
:ID: c63a113c-04b9-48c6-9a99-ca8e127233ea
:END:
i3 is a tiling window manager. It's used primarily through the keyboard, so muscle memory can operate everything very quickly once you get used to it. When a window is opened, it will be 'tiled', maximizing screen space. To open windows, rofi is used to search for applications and qubes.
**** Keybindings
:PROPERTIES:
:ID: 9bdcb7fa-d477-4554-9e20-a6030eb361d5
:END:
You can navigate i3 with 'vim-like' keybindings, inspired by the vi text editor. Some basic keybindings are shown below, and you can see many more by reading i3's config file at ~/srv/user_salt/dots/i3~
- S = Shift key
- mod = Windows/Command key
| keybinding | function |
|-------------------+----------------------------------------|
| mod + h/j/k/l | move focus left/down/up/right |
| mod + S + h/j/k/l | move focused window left/down/up/right |
| mod + d | search/launch programs with rofi |
| mod + S + d | switch between windows with rofi |
| mod + S + g | window gap settings menu |
*** Misc
:PROPERTIES:
:ID: effb5970-23b2-4a0c-9439-20fd76b86975
:END:
~wm.sls~ will do a few other smaller things:
- Sets my default wallpaper
- Sets xrandr default screenlayout, replace using ARandR
- Creates X11 touchpad configuration for tap-to-click + natural scrolling
- Sources default .bashrc config into ~/root/~ and ~/home/skylar/~ from ~/srv/user_salt/dots/.bashrc~
- Prioritize xfce4-terminal in ~/usr/bin/qubes-i3-sensible-terminal~
- Symlink rofi in place of dmenu
** My qubes
:PROPERTIES:
:ID: 166ecd06-a456-4d18-b3ed-ac633775e03e
:END:
*** Emacs
:PROPERTIES:
:ID: 3774aa41-f05b-4ee4-90c0-e2e40c6b0921
:END:
If you're a Doom Emacs user (there are dozens of us!) this will hopefully make your life slightly easier.
A template and app qube for Emacs will be created, Doom Emacs will automatically be installed inside the app qube, and the contents of (in dom0) ~/srv/user_salt/dots/doom-emacs~ will be added to the Doom Emacs qube.
My personal configuration is in the repository and will be written be default, but it's super simple to replace for your own (just find the directory mentioned above). I've done very little with my configuration, and use it basically as it comes out-of-the-box.
*** Torrenting
:PROPERTIES:
:ID: b83fe70b-f33f-4f7d-8081-de714db5ddd6
:END:
A template and app qube for qBittorrent will be created. The gruxbox theme that I use will be moved from dom0 to the app qube so it's easy to apply.
qBittorrent is a torrent client that lets you search for and download large files, particularly media files. You can enable the built-in search utility by doing the following:
1. Navigate to the "View" menu at the top of the window
2. Enable the "Search Engine" option
3. A new tab should show up slightly below called "Search", click it
4. In the new menu, click "Search plugins..." at the bottom
5. Click "Check for updates"
6. Once the search plugins are installed for a default list of trackers, you can close the window and search for media.
**** VPN use
:PROPERTIES:
:ID: 9932aa97-5b93-4609-8e39-6c842243a83d
:END:
If you're downloading copyrighted content in an area where it's illegal, I would strongly urge you consider using a VPN to hide your IP address. LE is unlikely to bust down your door for watching Spongebob, but copyright holders can and will send letters to your ISP, which can eventually get your internet service shut off if you continue. Tor can be used, but it's extremely slow, and hogs a lot of bandwidth on the network.
Personally, I use Mullvad and don't have any complaints. Proton and IVPN are reputable as well.
*** Personal/work email
:PROPERTIES:
:ID: 613c3c82-2920-437c-be50-696e171a9882
:END:
A template for email will be created, and two app qubes, "email-personal" and "email-work". These just have the Thunderbird email client installed so you can sign into your accounts.
** 3isec
:PROPERTIES:
:ID: 40987107-d090-43ca-b141-6a17c2435cc9
:END:
The 3isec repo is a handy repository of salt files with some miscellaneous utilities. The repository will be added to dom0, their gpg key will be added from this salt repository, and their graphical interface for it will be installed in dom0. You can start it with 'qubes-task-gui' in dom0.
I usually install common, mirage-firewall, monitor, mullvad-vpn, and sys-multimedia.
** Post install
:PROPERTIES:
:ID: a0303c81-5674-4394-84bb-5c3b8ef9461d
:END:
Almost everything will be done out of the box, but here are some recommended finishing touches:
- Open Emacs in its app qube, run nerd-icons-install-fonts, and reload your Emacs configuration
- Optionally replace config files with your own ~/srv/user_salt/~
- Optionally install any packages you'll want with 3isec
- Set the storage and networking settings of your qubes to your preference (by default everything will be routed through your default net-qube, probably sys-firewall)
** What's next?
:PROPERTIES:
:ID: 00633b3c-0d26-41c9-a342-7b6f6033d707
:END:
This project will develop over time as I learn more about Saltstack and continue to work on my personal configuration. I have lots of plans:
- Signal! I'm embarrassed to admit that I couldn't figure out how to add the Signal repo/gpg-key to a template to install signal-desktop. It's pretty easy to do imperatively, but it'll be a no-brainer to automate once I know a little bit more about Saltstack.
- Replace more templates with minimal ones to save on startup-time/space/updates
- qmenu scrips with rofi to do more with the keyboard
- Browser configuration. I like to set my browsers up in a similar way almost every time with a couple of favorite extensions and configuration. I want to implement this in Saltstack asap.
- A handful of other simple qubes that I often end up creating over time
- Write and implement bash and elisp scripts to improve various QubesOS/Emacs workflows
- Generally improve at Saltstack to make the config more extendable/robust/optimized
* Create an anonymous Whonix environment with KVM + NixOS :post:
:PROPERTIES:
:ID: b47779ca-2c6d-4311-9dac-001dd7dc020b
:PUBDATE: 2025-02-28 Fri 14:30
:END:
** The why
:PROPERTIES:
:ID: 47c11c59-9cb5-4143-ab6c-ad0546a8cecb
:END:
I've spent significant time using QubesOS on various computers, and I've been thoroughly spoiled by the VM magic Zen and the Qubes team have enabled. For a few reasons though, I've recently switched my main laptop from running QubesOS to NixOS. NixOS is great: it's declaratively managed, fast, stable, has tons of fresh packages, but I can't help but feel like my trust in the system has decreased a little bit due to the lack of isolation via virtualization that QubesOS provides.
(3/1/2025 update: I'm using QubesOS again)
Luckily, while VMs are fantastic to use especially with QubesOS, it's very much possible to get some of the benefits of QubesOS on a host Linux system like NixOS.
To demonstrate this, I'll be going through a Whonix installation on NixOS using KVM, nix.configuration, and home-manager. I'll talk a bit about the security trade-offs of using KVM over VirtualBox or on QubesOS, and how Whonix can be a useful tool for elevating your secure posture, protecting your host from malware and your activity from being deanonymized.
** What's Whonix?
:PROPERTIES:
:ID: af64a5d6-33b0-4de7-8efd-b76ebfcd2c3d
:END:
Whonix is a 2-VM setup for compartmentalizing your computing, and uses the Tor Network to keep your activity anonymous. It runs on KickSecure (hardened Debian).
The Whonix "Gateway" VM creates, maintains, and makes available a 'Tor-ified' network connection for the Workstation.
The Whonix "Workstation" VM is where you'll do your actual computing. It comes with a graphical XFCE desktop with a suite of applications. You can use the build-in Tor Browser to browse anonymously, or use any of the other included applications and have all of it routed through Tor.
** KVM vs VirtualBox
:PROPERTIES:
:ID: 9d82e5c7-b961-4770-9626-bac82b968c63
:END:
Whonix supports 2 type-2 hypervisors: KVM and VirtualBox. KVM is build into the Linux kernel, and is thus fully [[https://www.gnu.org/philosophy/free-sw.en.html][Free Software]]. VirtualBox is developed and maintained by Oracle, and is not Free software. I'll be using KVM for these examples, but there's a [[https://www.whonix.org/wiki/VirtualBox][convenient guide for VirtualBox]].
** KVM vs QubesOS Zen
:PROPERTIES:
:ID: cea6e5fc-9506-476e-a5ea-6e91f62e47ac
:END:
*** Hypervisor simplicity
:PROPERTIES:
:ID: ac60546d-e418-49e7-81e4-7dc3f812266f
:END:
KVM is part of the Linux kernel, meaning that the virtualization is being done by a larger, monolithic program than a type-1 hypervisor like Zen, with a larger attack surface.
*** Type-1 vs type-2 hypervisor
:PROPERTIES:
:ID: a031770f-27c7-42ff-a603-5593e0ba52a0
:END:
KVM runs on a host Linux system, and therefor the contents of the VM are only as secure as the host system. This is perhaps the biggest downside to running this KVM setup over Qubes in terms of security. I'd recommend delegating any risky activity to VMs like Whonix to try to mitigate the risk of malware running on your host system.
*** No sys-net/firewall/usb/audio/etc.
:PROPERTIES:
:ID: 639f9acf-94d0-4b49-abd5-e8e239687398
:END:
QubesOS uses VMs to compartmentalize the hardware, and running Whonix on a Linux host keeps those in the domain of the large Linux kernel.
*** Performance
:PROPERTIES:
:ID: f733af8a-d33c-487a-b609-40f75cda586a
:END:
Whonix on KVM performs about as well as on QubesOS (varying based on how much virtual CPU/memory you allocate of course), but a big benefit of having a Linux host is that the applications ran in it won't be slowed down by virtualization. Risky activities can be compartmentalized while keeping the main system fast and convenient to use.
*** Relevant Whonix security documentation
:PROPERTIES:
:ID: 3d6e8f20-0a28-4f09-bfb6-072bd693f0d2
:END:
The advantages QubesOS has over KVM listed above are just a few basic examples. QubesOS has a much more robust security model in many ways, and if your security is *essential*, you should understand the downsides:
- https://www.whonix.org/wiki/Qubes/Why_use_Qubes_over_other_Virtualizers
** Installing Whonix on KVM
:PROPERTIES:
:ID: e0335f30-3a55-408f-a6a3-24e022a64bfe
:END:
Make sure to check the relevant NixOS and Whonix documentation to ensure these examples are up-to-date. Always be weary of executing commands from a random blog on the internet, and go to the source whenever possible.
- [[https://nixos.wiki/wiki/Virt-manager]]
- [[https://www.whonix.org/wiki/KVM]]
Some of this setup (packages, user groups, dconf settings, the actual virtualization setup) is declaratively configured, but many of the commands to set up Whonix are not. On a fresh NixOS system build with your configuration.nix, you'll still need to download the Whonix images and set them up with the commands outlined below. It's possible more (or even all?) of this could be done declaratively with more NixOS knowledge.
*** Installing KVM + Virt-manager
:PROPERTIES:
:ID: 120183b6-2495-41d9-93be-0a6a43de95dd
:END:
Enable libvirtd and virt-manager
#+begin_src nix
# /etc/nixos/configuration.nix
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
#+end_src
Add user to the libvirtd group
#+begin_src nix
# /etc/nixos/configuration.nix
# Replace USER with your username
# extraGroups will likely be populated, just add libvirtd to whatever's already there
users.users.USER = {
extraGroups = [ "libvirtd" ];
};
#+end_src
Enable qemu connection by adding dconf settings through home-manager
#+begin_src nix
# /etc/nixos/configuration.nix
# Replace USER with your username
home-manager.users.USER = { pkgs, ... }: {
# Point virt-manager to qemu as a source for virtualization
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
};
#+end_src
Start qemu's virtual networking, allowing VMs to communicate
#+begin_src sh
# Start qemu networking
sudo virsh -c qemu:///system net-autostart default
sudo virsh -c qemu:///system net-start default
#+end_src
*** Download the Whonix XFCE .qcow archive
:PROPERTIES:
:ID: ae0caa76-6584-4ce4-b34e-1b5485d96e8b
:END:
- You can the most up-to-date versions directly from their website:
- https://www.whonix.org/wiki/KVM#Download_Whonix
- You can optionally append '.torrent' to the direct download URL on their site to download the torrent file. This can be used in any BitTorrent client to download with faster speeds and without using as much of the project's bandwidth. If you have a BitTorrent client I recommend this method.
*** Extract the archive
:PROPERTIES:
:ID: 84b8a85f-b84c-4924-9613-cc580e0b417d
:END:
Make sure your working directory and archive are both in your home directory. (You may need to src_sh[:exports code]{mv ~/Downloads/Whonix* ~/})
#+begin_src sh
# Unpacking archive with gnu tar
[~/]$ tar -xvf Whonix*.libvirt.xz
#+end_src
*** Agree to the Whonix Binary License Agreement
:PROPERTIES:
:ID: 3b2811df-e300-4ac0-b24f-5d565b794cb8
:END:
To read the agreement, use:
#+begin_src sh
# Prints the license agreement
[~/]$ more WHONIX_BINARY_LICENSE_AGREEMENT
#+end_src
Assuming you agree:
#+begin_src sh
# Creates an empty file "..._accepted" that tells Whonix you agree
[~/]$ touch WHONIX_BINARY_LICENSE_AGREEMENT_accepted
#+end_src
*** Setup Whonix virtual networks
:PROPERTIES:
:ID: 672fe99f-cc7d-48bc-b35c-4e19120e3e07
:END:
#+begin_src sh
# Add virtual networks
sudo virsh -c qemu:///system net-define Whonix_external*.xml
sudo virsh -c qemu:///system net-define Whonix_internal*.xml
# Activate the networks
sudo virsh -c qemu:///system net-autostart Whonix-External
sudo virsh -c qemu:///system net-start Whonix-External
sudo virsh -c qemu:///system net-autostart Whonix-Internal
sudo virsh -c qemu:///system net-start Whonix-Internal
#+end_src
*** Import Whonix Gateway and Workstation images
:PROPERTIES:
:ID: dc4ad386-98de-4a52-8bc3-46c636b88268
:END:
#+begin_src sh
# Creates two qemu profiles for the Whonix VMs
sudo virsh -c qemu:///system define Whonix-Gateway*.xml
sudo virsh -c qemu:///system define Whonix-Workstation*.xml
#+end_src
*** Image File Installation
:PROPERTIES:
:ID: 344f94f8-9ca8-42ab-9310-71fbc52667ba
:END:
#+begin_src sh
# Assigns those qemu VMs to the Whonix .qcow2 images
[~/]$ sudo mv Whonix-Gateway*.qcow2 /var/lib/libvirt/images/Whonix-Gateway.qcow2
[~/]$ sudo mv Whonix-Workstation*.qcow2 /var/lib/libvirt/images/Whonix-Workstation.qcow2
#+end_src
*** Remove Whonix home clutter
:PROPERTIES:
:ID: d5b6ffb8-dc5c-44e3-9365-ee0395697d2a
:END:
#+begin_src sh
# WARNING: running this command will delete every file that starts with "Whonix" or "WHONIX" in your working directory.
[~/]$ rm Whonix*
[~/]$ rm -r WHONIX*
#+end_src
** Post-installation
:PROPERTIES:
:ID: 3181e2ed-fecd-485b-a513-7cc2cc07fc04
:END:
Use the virt-manager application to start Whonix-Gateway, and open its terminal. We'll use setup-dist to create your Tor connection and otherwise prepare Whonix for use.
#+begin_src sh
# Whonix Gateway VM
[gateway user ~]% sudo setup-dist
#+end_src
Upgrade the system to pull the latest packages:
#+begin_src sh
# Whonix Gateway VM
[gateway user ~]% sudo apt-get dist-upgrade
#+end_src
Start the Whonix Workstation, and repeat the upgrade step:
#+begin_src sh
# Whonix Workstation VM
[workstation user ~]% sudo apt-get dist-upgrade
#+end_src
** Using Whonix
:PROPERTIES:
:ID: 1c369ab2-23e4-4c44-871d-06d24bd2f01e
:END:
Assuming the VMs are booting properly and can receive updates, you should be good to go! You now have a compartmentalized environment where your traffic will be anonymized, and any malware should generally be contained to the VM (sophisticated enough malware could theoretically jump the KVM hypervisor, but if that's part of your threat model you probably shouldn't be getting security advice from this blog :P)
*** Some tips
:PROPERTIES:
:ID: 12d1b372-d414-4002-b138-26c092b50f6f
:END:
**** Basic applications
:PROPERTIES:
:ID: 0fca1ceb-35b7-4ae2-bbb3-c1367622c2f9
:END:
- Tor Browser: Fingerprinting-resistant browser made for anonymous internet use
- VLC: Video player capable of playing almost media file you throw at it
- KeePassXC: Offline password manager
- GPA (Gnu privacy assistant): Graphical manager GPG/crypto functions
- Electrum: Bitcoin wallet
- Thunderbird: Mozilla email/calendar/RSS client
- and more!
**** Staying secure and anonymous
:PROPERTIES:
:ID: 3c1e4ae8-75a9-4813-a966-c0d756d9f270
:END:
Think before you act! Whonix gives you a good platform for staying anonymous, but you can absolutely de-anonymize yourself if you're not careful.
- If you're signing into a service over Tor, understand that the service can tie your actions to your current Tor identity. You can't sign into your personal Facebook over Tor and expect that Facebook won't know exactly who you are.
- If you're talking in some IRC channel, be skeptical about sharing information about yourself.
- If you're using Electrum wallet to manage Bitcoin, understand the privacy implications of Bitcoin and where you're sending/receiving from.
- Installing extra extensions in the Tor Browser can affect your footprint and make you stand out from other Whonix users
- etc, etc, etc
There are an uncountable number of ways you could de-anonymize yourself, so *stay vigilant*. Understand the technology you're using, the information you're putting out, and put yourself in the perspective of an adversary trying to de-anonymize you.
***** Use a live system when possible
:PROPERTIES:
:ID: 9092acc6-88c3-4f87-824f-874b2609e41c
:END:
When you're booting the Workstation VM, you can select the option to run it 'live'. This means that when you shutdown the VM, everything you did during the session is erased.
This can be useful, if say, you're vising a sketchy site and end up installing malware. Just reboot the VM and you're back to a clean state.
Ideally, you should only use Whonix persistantly for updating and installing packages from the Whonix repositories. You may want to also use a persistant session for setting up credentials in your KeePassXC database or setup GPG keys, but keep as much sporatic browsing as possible in the live mode.
***** Optionally disable Javascript in Tor Browser
:PROPERTIES:
:ID: 85a07874-ab33-4236-99eb-936d7ef366e6
:END:
Javascript adds a massive attack surface to your browser, and disabling it can remove entire categories of browser-based malware. But, many many sites rely on Javascript for basic functionality.
Personally, I keep Javascript on because I trust KVM to contain malware relatively well, and I only use the Tor Browser in live mode so any potential malware will be wiped on reboot.
If you care about further hardening the setup, and are willing to break many websites, Javascript can easily be disabled by setting the Tor Browser security level to the highest option.
|