diff options
author | Your Name <you@example.com> | 2025-04-02 23:38:41 -0600 |
---|---|---|
committer | Your Name <you@example.com> | 2025-04-02 23:38:41 -0600 |
commit | c282657ac899a4e170118c17b9f03675d00edb7a (patch) | |
tree | d2918223907a4d487d52722b4cc716f95a8082a2 | |
parent | 46e780b004309f675f93d01a551cd27b8fd161ed (diff) |
oops
-rw-r--r-- | feed.html | 895 |
1 files changed, 876 insertions, 19 deletions
@@ -3,10 +3,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> -<!-- 2025-04-02 Wed 23:36 --> +<!-- 2025-04-02 Wed 23:38 --> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>My Feed</title> +<title>Posts</title> <meta name="generator" content="Org Mode" /> <style type="text/css"> #content { max-width: 60em; margin: auto; } @@ -196,32 +196,122 @@ </head> <body> <div id="content" class="content"> -<h1 class="title">My Feed</h1> +<h1 class="title">Posts</h1> <div id="table-of-contents" role="doc-toc"> <h2>Table of Contents</h2> <div id="text-table-of-contents" role="doc-toc"> <ul> -<li><a href="#org96860f2">1. Prepping for v2 of my salt repo   <span class="tag"><span class="note">note</span></span></a></li> -<li><a href="#orgaae5c46">2. Methods of installing software in QubesOS w/ Saltstack   <span class="tag"><span class="post">post</span></span></a></li> -<li><a href="#org92315cc">3. Website update   <span class="tag"><span class="note">note</span></span></a></li> -<li><a href="#org7f08ec2">4. Convenient torrenting with qBittorrent   <span class="tag"><span class="post">post</span></span></a></li> -<li><a href="#org500c073">5. QubesOS Saltstack configuration v1   <span class="tag"><span class="post">post</span></span></a></li> +<li><a href="#org92a013c">1. Prepping for v2 of my salt repo   <span class="tag"><span class="note">note</span></span></a></li> +<li><a href="#org7cc1aad">2. Methods of installing software in QubesOS with Saltstack   <span class="tag"><span class="post">post</span></span></a></li> +<li><a href="#orgd0e10b1">3. Website update   <span class="tag"><span class="note">note</span></span></a></li> +<li><a href="#orgfdd3511">4. Convenient torrenting with qBittorrent   <span class="tag"><span class="post">post</span></span></a></li> +<li><a href="#orgf2b3513">5. QubesOS Saltstack configuration v1   <span class="tag"><span class="post">post</span></span></a></li> +<li><a href="#orgb0ed758">6. Create an anonymous Whonix environment with KVM + NixOS   <span class="tag"><span class="post">post</span></span></a></li> </ul> </div> </div> -<div id="outline-container-org96860f2" class="outline-2"> -<h2 id="org96860f2"><span class="section-number-2">1.</span> Prepping for v2 of my salt repo   <span class="tag"><span class="note">note</span></span></h2> +<div id="outline-container-org92a013c" class="outline-2"> +<h2 id="org92a013c"><span class="section-number-2">1.</span> Prepping for v2 of my salt repo   <span class="tag"><span class="note">note</span></span></h2> <div class="outline-text-2" id="text-1"> <p> 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. </p> </div> </div> -<div id="outline-container-orgaae5c46" class="outline-2"> -<h2 id="orgaae5c46"><span class="section-number-2">2.</span> <a href="org:../website/posts/installing-software-salt-qubes.org">Methods of installing software in QubesOS w/ Saltstack</a>   <span class="tag"><span class="post">post</span></span></h2> +<div id="outline-container-org7cc1aad" class="outline-2"> +<h2 id="org7cc1aad"><span class="section-number-2">2.</span> Methods of installing software in QubesOS with Saltstack   <span class="tag"><span class="post">post</span></span></h2> +<div class="outline-text-2" id="text-2"> +<p> +Here are some various methods of installing software that I’ve used in my personal salt configuration +</p> +</div> +<div id="outline-container-org0392429" class="outline-3"> +<h3 id="org0392429">pkg.installed</h3> +<div class="outline-text-3" id="text-org0392429"> +<p> +Here’s <code>/srv/user_salt/pkgs/accounting.sls</code> as an example. It uses the simplest way of installing programs, which is just listing them under <code>pkg.installed</code> which pulls them from your distros main repositories. This is the most preferable way to install software if it’s available. +</p> + +<div class="org-src-container"> +<pre class="src src-salt"><span style="color: #928374;"># </span><span style="color: #928374;">Install accounting tools</span> +<span style="color: #d3869b;">accounting--install-apps</span>: + <span style="color: #b8bb26;">pkg.installed</span>: + - <span style="color: #83a598;">pkgs</span>: + - hledger <span style="color: #928374;"># </span><span style="color: #928374;">Command-line plain text accounting</span> + - gnucash <span style="color: #928374;"># </span><span style="color: #928374;">Graphical GNU accounting suite</span> +</pre> +</div> +</div> +</div> +<div id="outline-container-org6cfaa26" class="outline-3"> +<h3 id="org6cfaa26">move a binary file into /usr/bin</h3> +<div class="outline-text-3" id="text-org6cfaa26"> +<p> +Here’s <code>/srv/user_salt/pkgs/st.sls</code> 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. +</p> + +<div class="org-src-container"> +<pre class="src src-salt"><span style="color: #928374;"># </span><span style="color: #928374;">Installs my build of st terminal</span> +<span style="color: #d3869b;">/usr/bin/st</span>: + <span style="color: #b8bb26;">file.managed</span>: + - <span style="color: #83a598;">source</span>: <span style="color: #fe8019;">salt://</span>pkgs/bin/st.bin + - <span style="color: #83a598;">user</span>: root + - <span style="color: #83a598;">group</span>: root + - <span style="color: #83a598;">mode</span>: 777 +</pre> +</div> +</div> +</div> +<div id="outline-container-orgbeb1762" class="outline-3"> +<h3 id="orgbeb1762">Install from third-party repo with a script</h3> +<div class="outline-text-3" id="text-orgbeb1762"> +<p> +Here’s <code>/srv/user_salt/pkgs/signal.sls</code> as an example. It starts by installing some dependencies using the most common <code>pkg.installed</code> method, then moves an install script <code>/srv/user_salt/pkgs/install-scripts/signal-repo.sh</code> into a qube and executes it to install the Signal messenger. +</p> + +<div class="org-src-container"> +<pre class="src src-salt"><span style="color: #928374;">...</span> + +<span style="color: #d3869b;">signal--repo-script</span>: + <span style="color: #b8bb26;">file.managed</span>: <span style="color: #928374;"># </span><span style="color: #928374;">file.managed lets you place files from your salt repo into qubes</span> + - <span style="color: #fe8019;">name</span>: /usr/bin/install-repo <span style="color: #928374;"># </span><span style="color: #928374;">this is where the installation script is placed</span> + - <span style="color: #83a598;">source</span>: <span style="color: #fe8019;">salt://</span>pkgs/install-scripts/signal-repo.sh <span style="color: #928374;"># </span><span style="color: #928374;">This is where the installation script was sourced</span> + - <span style="color: #83a598;">user</span>: root <span style="color: #928374;"># </span><span style="color: #928374;">sets the owner of the file, you can usually default to root</span> + - <span style="color: #83a598;">group</span>: root <span style="color: #928374;"># </span><span style="color: #928374;">sets the group of the file, you can usually default to root</span> + - <span style="color: #83a598;">mode</span>: 777 <span style="color: #928374;"># </span><span style="color: #928374;">sets the permissions of the file, you can usually default to 777 (any user on the qube has permissions)</span> + +<span style="color: #928374;"># </span><span style="color: #928374;">This simply executes the install-repo script in a qube</span> +<span style="color: #b8bb26;">'install-repo'</span>: + <span style="color: #b8bb26;">cmd.run</span> +</pre> +</div> + +<p> +Here’s the installation script that’s ran: +</p> +</div> +<div id="outline-container-org26c9aaf" class="outline-4"> +<h4 id="org26c9aaf"><code>/srv/user_salt/pkgs/install-scripts/signal-repo.sh</code></h4> +<div class="outline-text-4" id="text-org26c9aaf"> +<div class="org-src-container"> +<pre class="src src-bash"><span style="color: #928374;"># </span><span style="color: #928374;">Retrieves Signal's key for verifying the package</span> +<span style="color: #928374;"># </span><span style="color: #928374;">The request is proxied through 127.0.0.1:8082 to allow the template qube to access the internet</span> +<span style="color: #fabd2f;">sudo</span> <span style="color: #fabd2f;">curl</span> --proxy 127.0.0.1:8082 -s https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor | <span style="color: #fabd2f;">sudo</span> tee -a /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null + +<span style="color: #928374;"># </span><span style="color: #928374;">Defines Signal's repo in /etc/apt/sources.list.d/</span> +<span style="color: #fabd2f;">echo</span> <span style="color: #b8bb26;">'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main'</span> | tee /etc/apt/sources.list.d/signal-xenial.list + +<span style="color: #928374;"># </span><span style="color: #928374;">Updates packages and installs signal-desktop through the newly configured repository</span> +<span style="color: #fabd2f;">sudo</span> apt update +<span style="color: #fabd2f;">sudo</span> apt install signal-desktop -y +</pre> +</div> +</div> </div> -<div id="outline-container-org92315cc" class="outline-2"> -<h2 id="org92315cc"><span class="section-number-2">3.</span> Website update   <span class="tag"><span class="note">note</span></span></h2> +</div> +</div> +<div id="outline-container-orgd0e10b1" class="outline-2"> +<h2 id="orgd0e10b1"><span class="section-number-2">3.</span> Website update   <span class="tag"><span class="note">note</span></span></h2> <div class="outline-text-2" id="text-3"> <p> I’ve changed a few things about the website: @@ -240,15 +330,782 @@ I’ve figured out how to create an RSS feed using <code>ox-rss</code>, whic </p> </div> </div> -<div id="outline-container-org7f08ec2" class="outline-2"> -<h2 id="org7f08ec2"><span class="section-number-2">4.</span> <a href="org:../website/posts/qbittorrent.org">Convenient torrenting with qBittorrent</a>   <span class="tag"><span class="post">post</span></span></h2> +<div id="outline-container-orgfdd3511" class="outline-2"> +<h2 id="orgfdd3511"><span class="section-number-2">4.</span> Convenient torrenting with qBittorrent   <span class="tag"><span class="post">post</span></span></h2> +<div class="outline-text-2" id="text-4"> +</div> +<div id="outline-container-org45240a2" class="outline-3"> +<h3 id="org45240a2">Introduction</h3> +<div class="outline-text-3" id="text-org45240a2"> +<p> +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. +</p> +</div> +</div> +<div id="outline-container-org6960c87" class="outline-3"> +<h3 id="org6960c87">Install qBittorrent</h3> +<div class="outline-text-3" id="text-org6960c87"> +<p> +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 <a href="https://www.qbittorrent.org/download">https://www.qbittorrent.org/download</a> and select the right option for your computer. It supports Windows, MacOS, and can be installed through most common package managers on Linux. +</p> + +<p> +After it’s downloaded, install it like you would with any other program. +</p> +</div> +</div> +<div id="outline-container-org254a1b9" class="outline-3"> +<h3 id="org254a1b9">Enable the search engine</h3> +<div class="outline-text-3" id="text-org254a1b9"> +<p> +To let us search for media, we need to turn on qBittorrent’s search engine. +</p> +<ul class="org-ul"> +<li>Click the “View” button in the toolbar</li> +<li>Check the “Search Engine” box +There should now be a “Search” tab next to “Transfers” under the toolbar</li> +<li>Click the “Search” tab</li> +<li>Click “Search Plugins” at the bottom right</li> +<li>Click “Check for updates”</li> +<li>Click “Ok” and “Close” to exit the search plugins menu</li> +</ul> +</div> +</div> +<div id="outline-container-org6a19061" class="outline-3"> +<h3 id="org6a19061">Search for and download some media</h3> +<div class="outline-text-3" id="text-org6a19061"> +<ul class="org-ul"> +<li>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.</li> +</ul> +<p> +“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 +</p> +<ul class="org-ul"> +<li>Pick a result with a name indicating the media, resolution, and episodes/seasons you want. Double-click it</li> +<li>A download prompt will appear. It has lots of settings, but you can simply click “Ok” to download it normally.</li> +</ul> +</div> +</div> +<div id="outline-container-org7b2571c" class="outline-3"> +<h3 id="org7b2571c">Now just wait</h3> +<div class="outline-text-3" id="text-org7b2571c"> +<p> +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. +</p> + +<p> +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. +</p> +</div> +</div> +<div id="outline-container-org771d509" class="outline-3"> +<h3 id="org771d509">Extra tips</h3> +<div class="outline-text-3" id="text-org771d509"> +</div> +<div id="outline-container-org416b253" class="outline-4"> +<h4 id="org416b253">Consider using a VPN</h4> +<div class="outline-text-4" id="text-org416b253"> +<p> +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. +</p> +</div> +</div> +<div id="outline-container-orgbfb2fb3" class="outline-4"> +<h4 id="orgbfb2fb3">Stream Media</h4> +<div class="outline-text-4" id="text-orgbfb2fb3"> +<p> +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”. +</p> + +<p> +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. +</p> +</div> +</div> +<div id="outline-container-orgd556c9a" class="outline-4"> +<h4 id="orgd556c9a">Hosting a media server with Jellyfin</h4> +<div class="outline-text-4" id="text-orgd556c9a"> +<p> +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. +</p> + +<p> +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. +</p> + +<p> +<a href="https://jellyfin.org/">https://jellyfin.org/</a> +</p> +</div> +</div> +</div> +</div> +<div id="outline-container-orgf2b3513" class="outline-2"> +<h2 id="orgf2b3513"><span class="section-number-2">5.</span> QubesOS Saltstack configuration v1   <span class="tag"><span class="post">post</span></span></h2> +<div class="outline-text-2" id="text-5"> +</div> +<div id="outline-container-orgec5d948" class="outline-3"> +<h3 id="orgec5d948">Notice:</h3> +<div class="outline-text-3" id="text-orgec5d948"> +<p> +<b>The repository is now hosted on this site at <a href="https://git.skylarcloud.xyz">https://git.skylarcloud.xyz</a>, 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.</b> +</p> +</div> +</div> +<div id="outline-container-org96d0728" class="outline-3"> +<h3 id="org96d0728">Intro</h3> +<div class="outline-text-3" id="text-org96d0728"> +<p> +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. +</p> + +<p> +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. +</p> + +<p> +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. +</p> +</div> +<div id="outline-container-orgf5bbf63" class="outline-4"> +<h4 id="orgf5bbf63">Link to repo on Github</h4> +<div class="outline-text-4" id="text-orgf5bbf63"> +<p> +<a href="https://github.com/bumbleoats/My-QubesOS-Configuration">https://github.com/bumbleoats/My-QubesOS-Configuration</a> +</p> +</div> +</div> +<div id="outline-container-org4a01840" class="outline-4"> +<h4 id="org4a01840">Installation</h4> +<div class="outline-text-4" id="text-org4a01840"> +<p> +Make sure <code>state.user-dirs</code> is active, then just move the repo to <code>/srv/user_salt/</code> in dom0, and apply with <code>sudo qubesctl --all state.apply</code> +</p> +</div> +<ul class="org-ul"> +<li><a id="org6b5d8e3"></a>Resources for installation<br /> +<div class="outline-text-5" id="text-org6b5d8e3"> +</div> +<ul class="org-ul"> +<li><a id="orgf32780a"></a>Community user guide for user-salt<br /> +<div class="outline-text-6" id="text-orgf32780a"> +<ul class="org-ul"> +<li><a href="https://forum.qubes-os.org/t/qubes-salt-beginners-guide/20126">https://forum.qubes-os.org/t/qubes-salt-beginners-guide/20126</a></li> +<li>This was the best resource I found as a beginner, I wasn’t able to get anything working until I stumbled on it</li> +</ul> +</div> +</li> +<li><a id="org106af42"></a>Issue I sometimes run into from a fresh QubesOS install<br /> +<div class="outline-text-6" id="text-org106af42"> +<ul class="org-ul"> +<li><a href="https://github.com/QubesOS/qubes-issues/issues/8491">https://github.com/QubesOS/qubes-issues/issues/8491</a></li> +<li>TL;DR: This is the solution that’s worked for me, pulled from the discussion:</li> +</ul> +<div class="org-src-container"> +<pre class="src src-bash"><span style="color: #fabd2f;">ln</span> -s /srv/salt/qubes/user-dirs.top /srv/salt/_tops/base/user-dirs.top +</pre> +</div> +</div> +</li> +</ul> +</li> +</ul> +</div> +</div> +<div id="outline-container-org97e2659" class="outline-3"> +<h3 id="org97e2659">Programs in dom0</h3> +<div class="outline-text-3" id="text-org97e2659"> +<p> +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. +</p> + +<p> +Look in <code>/srv/user_salt/</code> to find the related salt files and see the installed programs. +</p> +</div> +</div> +<div id="outline-container-org5ac2980" class="outline-3"> +<h3 id="org5ac2980">Window Management</h3> +<div class="outline-text-3" id="text-org5ac2980"> +</div> +<div id="outline-container-org3e22dea" class="outline-4"> +<h4 id="org3e22dea">i3</h4> +<div class="outline-text-4" id="text-org3e22dea"> +<p> +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. +</p> +</div> +<ul class="org-ul"> +<li><a id="org1546251"></a>Keybindings<br /> +<div class="outline-text-5" id="text-org1546251"> +<p> +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 <code>/srv/user_salt/dots/i3</code> +</p> + +<ul class="org-ul"> +<li>S = Shift key</li> +<li>mod = Windows/Command key</li> +</ul> + +<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> + + +<colgroup> +<col class="org-left" /> + +<col class="org-left" /> +</colgroup> +<thead> +<tr> +<th scope="col" class="org-left">keybinding</th> +<th scope="col" class="org-left">function</th> +</tr> +</thead> +<tbody> +<tr> +<td class="org-left">mod + h/j/k/l</td> +<td class="org-left">move focus left/down/up/right</td> +</tr> + +<tr> +<td class="org-left">mod + S + h/j/k/l</td> +<td class="org-left">move focused window left/down/up/right</td> +</tr> + +<tr> +<td class="org-left">mod + d</td> +<td class="org-left">search/launch programs with rofi</td> +</tr> + +<tr> +<td class="org-left">mod + S + d</td> +<td class="org-left">switch between windows with rofi</td> +</tr> + +<tr> +<td class="org-left">mod + S + g</td> +<td class="org-left">window gap settings menu</td> +</tr> +</tbody> +</table> +</div> +</li> +</ul> +</div> +<div id="outline-container-org43c8f11" class="outline-4"> +<h4 id="org43c8f11">Misc</h4> +<div class="outline-text-4" id="text-org43c8f11"> +<p> +<code>wm.sls</code> will do a few other smaller things: +</p> +<ul class="org-ul"> +<li>Sets my default wallpaper</li> +<li>Sets xrandr default screenlayout, replace using ARandR</li> +<li>Creates X11 touchpad configuration for tap-to-click + natural scrolling</li> +<li>Sources default .bashrc config into <code>/root/</code> and <code>/home/skylar/</code> from <code>/srv/user_salt/dots/.bashrc</code></li> +<li>Prioritize xfce4-terminal in <code>/usr/bin/qubes-i3-sensible-terminal</code></li> +<li>Symlink rofi in place of dmenu</li> +</ul> +</div> +</div> +</div> +<div id="outline-container-org4aa5196" class="outline-3"> +<h3 id="org4aa5196">My qubes</h3> +<div class="outline-text-3" id="text-org4aa5196"> +</div> +<div id="outline-container-orgfe9b8a3" class="outline-4"> +<h4 id="orgfe9b8a3">Emacs</h4> +<div class="outline-text-4" id="text-orgfe9b8a3"> +<p> +If you’re a Doom Emacs user (there are dozens of us!) this will hopefully make your life slightly easier. +</p> + +<p> +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) <code>/srv/user_salt/dots/doom-emacs</code> will be added to the Doom Emacs qube. +</p> + +<p> +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. +</p> +</div> +</div> +<div id="outline-container-orge761ea1" class="outline-4"> +<h4 id="orge761ea1">Torrenting</h4> +<div class="outline-text-4" id="text-orge761ea1"> +<p> +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. +</p> + +<p> +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: +</p> + +<ol class="org-ol"> +<li>Navigate to the “View” menu at the top of the window</li> +<li>Enable the “Search Engine” option</li> +<li>A new tab should show up slightly below called “Search”, click it</li> +<li>In the new menu, click “Search plugins…” at the bottom</li> +<li>Click “Check for updates”</li> +<li>Once the search plugins are installed for a default list of trackers, you can close the window and search for media.</li> +</ol> +</div> +<ul class="org-ul"> +<li><a id="org0c1c9dd"></a>VPN use<br /> +<div class="outline-text-5" id="text-org0c1c9dd"> +<p> +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. +</p> + +<p> +Personally, I use Mullvad and don’t have any complaints. Proton and IVPN are reputable as well. +</p> +</div> +</li> +</ul> +</div> +<div id="outline-container-org0691058" class="outline-4"> +<h4 id="org0691058">Personal/work email</h4> +<div class="outline-text-4" id="text-org0691058"> +<p> +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. +</p> +</div> +</div> +</div> +<div id="outline-container-org7793284" class="outline-3"> +<h3 id="org7793284">3isec</h3> +<div class="outline-text-3" id="text-org7793284"> +<p> +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. +</p> + +<p> +I usually install common, mirage-firewall, monitor, mullvad-vpn, and sys-multimedia. +</p> +</div> +</div> +<div id="outline-container-org50ce9ff" class="outline-3"> +<h3 id="org50ce9ff">Post install</h3> +<div class="outline-text-3" id="text-org50ce9ff"> +<p> +Almost everything will be done out of the box, but here are some recommended finishing touches: +</p> +<ul class="org-ul"> +<li>Open Emacs in its app qube, run nerd-icons-install-fonts, and reload your Emacs configuration</li> +<li>Optionally replace config files with your own <code>/srv/user_salt/</code></li> +<li>Optionally install any packages you’ll want with 3isec</li> +<li>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)</li> +</ul> +</div> +</div> +<div id="outline-container-org1664162" class="outline-3"> +<h3 id="org1664162">What’s next?</h3> +<div class="outline-text-3" id="text-org1664162"> +<p> +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: +</p> + +<ul class="org-ul"> +<li>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.</li> +<li>Replace more templates with minimal ones to save on startup-time/space/updates</li> +<li>qmenu scrips with rofi to do more with the keyboard</li> +<li>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.</li> +<li>A handful of other simple qubes that I often end up creating over time</li> +<li>Write and implement bash and elisp scripts to improve various QubesOS/Emacs workflows</li> +<li>Generally improve at Saltstack to make the config more extendable/robust/optimized</li> +</ul> +</div> +</div> +</div> +<div id="outline-container-orgb0ed758" class="outline-2"> +<h2 id="orgb0ed758"><span class="section-number-2">6.</span> Create an anonymous Whonix environment with KVM + NixOS   <span class="tag"><span class="post">post</span></span></h2> +<div class="outline-text-2" id="text-6"> +</div> +<div id="outline-container-org815dab3" class="outline-3"> +<h3 id="org815dab3">The why</h3> +<div class="outline-text-3" id="text-org815dab3"> +<p> +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. +</p> + +<p> +(3/1/2025 update: I’m using QubesOS again) +</p> + +<p> +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. +</p> + +<p> +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. +</p> +</div> +</div> +<div id="outline-container-orgd3d1732" class="outline-3"> +<h3 id="orgd3d1732">What’s Whonix?</h3> +<div class="outline-text-3" id="text-orgd3d1732"> +<p> +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). +</p> + +<p> +The Whonix “Gateway” VM creates, maintains, and makes available a ’Tor-ified’ network connection for the Workstation. +</p> + +<p> +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. +</p> +</div> +</div> +<div id="outline-container-orgaa23ae9" class="outline-3"> +<h3 id="orgaa23ae9">KVM vs VirtualBox</h3> +<div class="outline-text-3" id="text-orgaa23ae9"> +<p> +Whonix supports 2 type-2 hypervisors: KVM and VirtualBox. KVM is build into the Linux kernel, and is thus fully <a href="https://www.gnu.org/philosophy/free-sw.en.html">Free Software</a>. VirtualBox is developed and maintained by Oracle, and is not Free software. I’ll be using KVM for these examples, but there’s a <a href="https://www.whonix.org/wiki/VirtualBox">convenient guide for VirtualBox</a>. +</p> +</div> +</div> +<div id="outline-container-orgde3d30e" class="outline-3"> +<h3 id="orgde3d30e">KVM vs QubesOS Zen</h3> +<div class="outline-text-3" id="text-orgde3d30e"> +</div> +<div id="outline-container-org2fbf001" class="outline-4"> +<h4 id="org2fbf001">Hypervisor simplicity</h4> +<div class="outline-text-4" id="text-org2fbf001"> +<p> +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. +</p> +</div> +</div> +<div id="outline-container-org96b4c08" class="outline-4"> +<h4 id="org96b4c08">Type-1 vs type-2 hypervisor</h4> +<div class="outline-text-4" id="text-org96b4c08"> +<p> +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. +</p> +</div> +</div> +<div id="outline-container-org1edd4ce" class="outline-4"> +<h4 id="org1edd4ce">No sys-net/firewall/usb/audio/etc.</h4> +<div class="outline-text-4" id="text-org1edd4ce"> +<p> +QubesOS uses VMs to compartmentalize the hardware, and running Whonix on a Linux host keeps those in the domain of the large Linux kernel. +</p> +</div> +</div> +<div id="outline-container-org442fb32" class="outline-4"> +<h4 id="org442fb32">Performance</h4> +<div class="outline-text-4" id="text-org442fb32"> +<p> +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. +</p> +</div> +</div> +<div id="outline-container-orgeb1366d" class="outline-4"> +<h4 id="orgeb1366d">Relevant Whonix security documentation</h4> +<div class="outline-text-4" id="text-orgeb1366d"> +<p> +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 <b>essential</b>, you should understand the downsides: +</p> +<ul class="org-ul"> +<li><a href="https://www.whonix.org/wiki/Qubes/Why_use_Qubes_over_other_Virtualizers">https://www.whonix.org/wiki/Qubes/Why_use_Qubes_over_other_Virtualizers</a></li> +</ul> +</div> +</div> +</div> +<div id="outline-container-orgc87bcf1" class="outline-3"> +<h3 id="orgc87bcf1">Installing Whonix on KVM</h3> +<div class="outline-text-3" id="text-orgc87bcf1"> +<p> +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. +</p> + +<ul class="org-ul"> +<li><a href="https://nixos.wiki/wiki/Virt-manager">https://nixos.wiki/wiki/Virt-manager</a></li> +<li><a href="https://www.whonix.org/wiki/KVM">https://www.whonix.org/wiki/KVM</a></li> +</ul> + +<p> +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. +</p> +</div> +<div id="outline-container-org3ecff6f" class="outline-4"> +<h4 id="org3ecff6f">Installing KVM + Virt-manager</h4> +<div class="outline-text-4" id="text-org3ecff6f"> +<p> +Enable libvirtd and virt-manager +</p> + +<div class="org-src-container"> +<pre class="src src-nix"> # /etc/nixos/configuration.nix + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; +</pre> +</div> + +<p> +Add user to the libvirtd group +</p> + +<div class="org-src-container"> +<pre class="src 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" ]; + }; +</pre> +</div> + +<p> +Enable qemu connection by adding dconf settings through home-manager +</p> + +<div class="org-src-container"> +<pre class="src 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"]; + }; + }; + }; +</pre> +</div> + +<p> +Start qemu’s virtual networking, allowing VMs to communicate +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Start qemu networking</span> +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-autostart default +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-start default +</pre> +</div> +</div> +</div> +<div id="outline-container-org2dd06a0" class="outline-4"> +<h4 id="org2dd06a0">Download the Whonix XFCE .qcow archive</h4> +<div class="outline-text-4" id="text-org2dd06a0"> +<ul class="org-ul"> +<li>You can the most up-to-date versions directly from their website: +<ul class="org-ul"> +<li><a href="https://www.whonix.org/wiki/KVM#Download_Whonix">https://www.whonix.org/wiki/KVM#Download_Whonix</a></li> +<li>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.</li> +</ul></li> +</ul> +</div> +</div> +<div id="outline-container-org9971a74" class="outline-4"> +<h4 id="org9971a74">Extract the archive</h4> +<div class="outline-text-4" id="text-org9971a74"> +<p> +Make sure your working directory and archive are both in your home directory. (You may need to <code class="src src-sh"><span style="color: #fabd2f;">mv</span> ~/Downloads/Whonix* ~/</code>) +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Unpacking archive with gnu tar</span> +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ tar -xvf Whonix*.libvirt.xz +</pre> +</div> +</div> +</div> +<div id="outline-container-orgdb63c62" class="outline-4"> +<h4 id="orgdb63c62">Agree to the Whonix Binary License Agreement</h4> +<div class="outline-text-4" id="text-orgdb63c62"> +<p> +To read the agreement, use: +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Prints the license agreement</span> +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ more WHONIX_BINARY_LICENSE_AGREEMENT +</pre> +</div> + +<p> +Assuming you agree: +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Creates an empty file "..._accepted" that tells Whonix you agree</span> +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ <span style="color: #fabd2f;">touch</span> WHONIX_BINARY_LICENSE_AGREEMENT_accepted +</pre> +</div> +</div> +</div> +<div id="outline-container-org2bca6d8" class="outline-4"> +<h4 id="org2bca6d8">Setup Whonix virtual networks</h4> +<div class="outline-text-4" id="text-org2bca6d8"> +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Add virtual networks</span> +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-define Whonix_external*.xml +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-define Whonix_internal*.xml + +<span style="color: #928374;"># </span><span style="color: #928374;">Activate the networks</span> +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-autostart Whonix-External +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-start Whonix-External +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-autostart Whonix-Internal +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system net-start Whonix-Internal +</pre> +</div> +</div> +</div> +<div id="outline-container-org6d6496e" class="outline-4"> +<h4 id="org6d6496e">Import Whonix Gateway and Workstation images</h4> +<div class="outline-text-4" id="text-org6d6496e"> +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Creates two qemu profiles for the Whonix VMs</span> +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system define Whonix-Gateway*.xml +<span style="color: #fabd2f;">sudo</span> virsh -c qemu:///system define Whonix-Workstation*.xml +</pre> +</div> +</div> +</div> +<div id="outline-container-org15f2984" class="outline-4"> +<h4 id="org15f2984">Image File Installation</h4> +<div class="outline-text-4" id="text-org15f2984"> +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Assigns those qemu VMs to the Whonix .qcow2 images</span> +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ <span style="color: #fabd2f;">sudo</span> <span style="color: #fabd2f;">mv</span> Whonix-Gateway*.qcow2 /var/lib/libvirt/images/Whonix-Gateway.qcow2 +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ <span style="color: #fabd2f;">sudo</span> <span style="color: #fabd2f;">mv</span> Whonix-Workstation*.qcow2 /var/lib/libvirt/images/Whonix-Workstation.qcow2 +</pre> +</div> +</div> +</div> +<div id="outline-container-org22df4ed" class="outline-4"> +<h4 id="org22df4ed">Remove Whonix home clutter</h4> +<div class="outline-text-4" id="text-org22df4ed"> +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">WARNING: running this command will delete every file that starts with "Whonix" or "WHONIX" in your working directory.</span> +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ <span style="color: #fabd2f;">rm</span> Whonix* +<span style="color: #fe8019;">[</span>~/<span style="color: #fe8019;">]</span>$ <span style="color: #fabd2f;">rm</span> -r WHONIX* +</pre> +</div> +</div> +</div> +</div> +<div id="outline-container-org5d5d6e9" class="outline-3"> +<h3 id="org5d5d6e9">Post-installation</h3> +<div class="outline-text-3" id="text-org5d5d6e9"> +<p> +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. +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Whonix Gateway VM</span> +<span style="color: #fe8019;">[</span>gateway user ~<span style="color: #fe8019;">]</span>% <span style="color: #fabd2f;">sudo</span> setup-dist +</pre> +</div> + +<p> +Upgrade the system to pull the latest packages: +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Whonix Gateway VM</span> +<span style="color: #fe8019;">[</span>gateway user ~<span style="color: #fe8019;">]</span>% <span style="color: #fabd2f;">sudo</span> apt-get dist-upgrade +</pre> +</div> + +<p> +Start the Whonix Workstation, and repeat the upgrade step: +</p> + +<div class="org-src-container"> +<pre class="src src-sh"><span style="color: #928374;"># </span><span style="color: #928374;">Whonix Workstation VM</span> +<span style="color: #fe8019;">[</span>workstation user ~<span style="color: #fe8019;">]</span>% <span style="color: #fabd2f;">sudo</span> apt-get dist-upgrade +</pre> +</div> +</div> +</div> +<div id="outline-container-org7bd01ef" class="outline-3"> +<h3 id="org7bd01ef">Using Whonix</h3> +<div class="outline-text-3" id="text-org7bd01ef"> +<p> +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) +</p> +</div> +<div id="outline-container-org60e781c" class="outline-4"> +<h4 id="org60e781c">Some tips</h4> +<div class="outline-text-4" id="text-org60e781c"> +</div> +<ul class="org-ul"> +<li><a id="org3b8b04c"></a>Basic applications<br /> +<div class="outline-text-5" id="text-org3b8b04c"> +<ul class="org-ul"> +<li>Tor Browser: Fingerprinting-resistant browser made for anonymous internet use</li> +<li>VLC: Video player capable of playing almost media file you throw at it</li> +<li>KeePassXC: Offline password manager</li> +<li>GPA (Gnu privacy assistant): Graphical manager GPG/crypto functions</li> +<li>Electrum: Bitcoin wallet</li> +<li>Thunderbird: Mozilla email/calendar/RSS client</li> +<li>and more!</li> +</ul> +</div> +</li> +<li><a id="org0279056"></a>Staying secure and anonymous<br /> +<div class="outline-text-5" id="text-org0279056"> +<p> +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. +</p> + +<ul class="org-ul"> +<li>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.</li> +<li>If you’re talking in some IRC channel, be skeptical about sharing information about yourself.</li> +<li>If you’re using Electrum wallet to manage Bitcoin, understand the privacy implications of Bitcoin and where you’re sending/receiving from.</li> +<li>Installing extra extensions in the Tor Browser can affect your footprint and make you stand out from other Whonix users</li> +<li>etc, etc, etc</li> +</ul> + +<p> +There are an uncountable number of ways you could de-anonymize yourself, so <b>stay vigilant</b>. 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. +</p> +</div> +<ul class="org-ul"> +<li><a id="org94a94c9"></a>Use a live system when possible<br /> +<div class="outline-text-6" id="text-org94a94c9"> +<p> +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. +</p> + +<p> +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. +</p> + +<p> +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. +</p> +</div> +</li> +<li><a id="org289d6fe"></a>Optionally disable Javascript in Tor Browser<br /> +<div class="outline-text-6" id="text-org289d6fe"> +<p> +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. +</p> + +<p> +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. +</p> + +<p> +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. +</p> +</div> +</li> +</ul> +</li> +</ul> +</div> </div> -<div id="outline-container-org500c073" class="outline-2"> -<h2 id="org500c073"><span class="section-number-2">5.</span> <a href="org:../website/posts/qubes-salt-v1.org">QubesOS Saltstack configuration v1</a>   <span class="tag"><span class="post">post</span></span></h2> </div> </div> <div id="postamble" class="status"> -<p class="date">Created: 2025-04-02 Wed 23:36</p> +<p class="date">Created: 2025-04-02 Wed 23:38</p> </div> </body> </html> |