<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Romain Mondon-Cancel on Medium]]></title>
        <description><![CDATA[Stories by Romain Mondon-Cancel on Medium]]></description>
        <link>https://medium.com/@skasch?source=rss-b7c684c47aba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dANKe1nRLkSgzUjC.</url>
            <title>Stories by Romain Mondon-Cancel on Medium</title>
            <link>https://medium.com/@skasch?source=rss-b7c684c47aba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 15:45:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@skasch/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[[2/2] From Amazon to Windows 10 on a KVM]]></title>
            <link>https://medium.com/@skasch/2-2-from-amazon-to-windows-10-on-a-kvm-937ef77d9103?source=rss-b7c684c47aba------2</link>
            <guid isPermaLink="false">https://medium.com/p/937ef77d9103</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[kvm]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <dc:creator><![CDATA[Romain Mondon-Cancel]]></dc:creator>
            <pubDate>Tue, 29 Aug 2017 18:30:34 GMT</pubDate>
            <atom:updated>2020-03-14T18:18:09.954Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part two — from a running computer to Windows 10 on a KVM</h4><h3>A new computer for a fresh start</h3><p>This is the second part of the story behind my new computer. I described how I built my computer and installed <a href="https://www.ubuntu.com/">Ubuntu</a> on it on <a href="https://medium.com/p/6adddfe57719">a previous post</a>. As a reminder, here are the different features I want for my computer:</p><ul><li>Having a 24/7 Linux-based machine running on my local network, offering different services to the other machines, notable a <a href="https://symless.com/synergy">Synergy</a> server for mouse and keyboard sharing and a <a href="https://www.samba.org/samba/what_is_samba.html">Samba</a> server for file sharing,</li><li>Setting up remote access to my Linux system through <a href="https://en.wikipedia.org/wiki/Virtual_private_network">VPN</a> on my router using <a href="https://openvpn.net/">OpenVPN</a>, with <a href="https://en.wikipedia.org/wiki/Secure_Shell">SSH</a> access and <a href="https://en.wikipedia.org/wiki/Virtual_Network_Computing">VNC</a> through <a href="https://en.wikipedia.org/wiki/Tunneling_protocol#Secure_Shell_tunneling">SSH tunneling</a>,</li><li>Setting up <a href="https://en.wikipedia.org/wiki/Wake-on-LAN">Wake On LAN</a> for both my Linux and Windows systems,</li><li>Using <a href="https://www.nvidia.com/en-us/shield/games/gamestream/">NVidia GameStream</a> to play on my TV from the Windows system (and ideally, from anywhere in the world; talking about portability).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fY6-RFlOGxV-5k42PyQ6cA.jpeg" /><figcaption>My desktop, up and running!</figcaption></figure><h3>Chapter 4 — Setting up Ubuntu</h3><p>First things first, let’s update our system; open a “<a href="https://en.wikipedia.org/wiki/Terminal_emulator">Terminal</a>” (using the top-left icon to open a search field) window and run:</p><pre>sudo apt-get update<br>sudo apt-get upgrade</pre><p><a href="https://help.ubuntu.com/community/AptGet/Howto">apt-get</a> is the package manager used by Ubuntu to manage the software installed on the machine. After a quick reboot, everything should be up to date.</p><h4>Firewall, SSH, Vim and git</h4><p>For security reasons, even though the system is supposedly behind the firewall of my router and hence not directly accessible from outside the local network, it would be better to set up a firewall on the machine; we can do that with the easy to configure <a href="https://help.ubuntu.com/community/UFW">ufw</a> on Ubuntu:</p><pre>sudo ufw enable</pre><p>Now, we shall install a couple basic things (which I am always surprised are not installed by default): <a href="https://help.ubuntu.com/lts/serverguide/openssh-server.html">OpenSSH</a>, a service that will run on our computer allowing us to connect to it remotely, via the network, using the SSH protocol; <a href="https://help.ubuntu.com/community/VimHowto">Vim</a>, a console-based text editor; and <a href="https://help.ubuntu.com/community/Git">Git</a>, a versioning manager, which we will practically use to download the latest versions of different projects.</p><p>Vim is of course a personal choice, feel free to use whichever text editor you prefer; nano or gedit (if you’d rather have a GUI) are for example great alternatives.</p><pre>sudo apt-get install openssh<br>sudo apt-get install vim<br>sudo apt-get install git</pre><p>We definitely want to grant ssh access from outside our system; SSH use the port 22 by default:</p><pre>sudo ufw allow 22</pre><p>Generally speaking, when setting up networking features, it is a good idea to temporarily disable ufw to make sure things work as expected before setting up the permissions: to do so:</p><ul><li>use the sudo ufw disable command to disable ufw,</li><li>set up and test your new feature until it work,</li><li>use the sudo ufw enable command to enable back ufw,</li><li>add the relevant rules to ufw to allow traffic for this new feature.</li></ul><p>It will save you precious minutes trying to tweak a .conf file before realizing it was just the firewall denying the traffic.</p><p>After a reboot to make sure the services start as intended, I configured my router to statically allocate the IP address of my computer: my-desktop -&gt; 192.168.0.80.</p><h4>Overclocking</h4><p>As the i7–7700K is supposedly specifically designed to be <a href="https://en.wikipedia.org/wiki/Overclocking">overclocked</a>, I reckoned it would be a shame not to overclock it. Nevertheless, I wanted to be pretty conservative when overclocking it; I want my system to be reliable rather than powerful.</p><p>First things first, if we want to overclock, we need to install a couple things to stress test our CPU and monitor its temperature. On Ubuntu, I used:</p><ul><li><a href="https://www.mersenne.org/download/">prime95</a>, a software for distributed prime computing; it’s an excellent software to push the CPU to its limits. Once the tar.gz file downloaded, simply extract it to some folder, then go to this folder in command line (cd name_of_folder to move to a specific folder, ls to list files in a folder) and run ./mprime. It will then ask a couple things, answer that we just want to torture the CPU.</li><li>To check the status of our CPU, we are going to install lm-sensors, which is a console-based application to display the status of our computer sensors. Let’s install it with sudo apt-get install lm-sensors. We then need to detect our sensors, with sudo sensors-detect; this will ask us a couple questions, let’s answer “yes” to all. Finally, running sensors will display information about our desktop, with CPU cores temperatures.</li></ul><p>We will then typically run mprime for some time while running sensors in another terminal to regularly check the status of the CPU cores.</p><p>I partly followed <a href="http://www.overclock.net/t/1621347/kaby-lake-overclocking-guide-with-statistics">this great guide</a> to overclock the i7–7700K, which is an in-depth guide to overclocking. I had a pretty lazy approach, because I did not want to reach the optimum, but rather a good and stable configuration.</p><p>Let’s restart our computer and access our BIOS. Here, there should be a menu to access the clock setup of the motherboard; on mine, it was the “OC” menu (for overclocking; duh). The most important thing is the “CPU Ratio”, which is an integer; it is the value by which the “CPU Base Clock” frequency is multiplied to determine the CPU frequency. By default, the base clock is set to 100 MHz, which means a CPU Ratio of 42 (my default value) will bring the CPU frequency up to 4,200 MHz, or 4.2 GHz. I started by setting the “CPU Ratio” to 48, bringing the frequency to 4.8 GHz, before saving and restarting the computer.</p><p>Back to the Ubuntu system, let’s stress test this setup: open a terminal, reach and run the mprime application asking it to torture our CPU; once running, open a second terminal to monitor the CPU cores temperature with sensors. It should reach high temperatures pretty quickly, up to about 80 degrees (Celcius). After letting mprime run for some time (ideally, for about an hour, but I left it for about twenty minutes), if Ubuntu is still up and running, it’s good news: the system is stable at this frequency. If the system crashed, well, tough luck, you’d better tune the CPU frequency down or increase the voltage.</p><p>It ran smoothly on my side, but the temperatures reached were slightly higher than what I wanted, up to 83/84 degrees; I hence decided to tune the CPU down to 4.7 GHz, and called it a day.</p><h4>Synergy</h4><p><a href="https://symless.com/synergy">Synergy</a> is a paid software developed by Symless to share a keyboard and a mouse across multiple computers. It requires one server and multiple clients, one for each additional system to connect. It is a very convenient way to share a keyboard and a mouse between a supervisor and a KVM.</p><p>After buying Synergy Pro (for encryption; I don’t like the idea of keystrokes being sent over the network without encryption, even if it’s a local one), we can go to our download page to download the .deb file. A double-click on the file and it’s installed on the system.</p><p>Once installed, let’s start the application searching for “synergy” in the start menu. In the window that just opened, check “Server” to run Synergy as a server on Ubuntu. We will then have to set up the other Synergy applications as “Client” on the other computers specifying the IP address of this computer to connect them to the server (192.168.0.80 in our case).</p><p>For a basic configuration of the server, click on the “Configure Server…” button; then, on the “Screens and links” tab:</p><ul><li>drag and drop the screen on the upper-right corner somewhere next to the central screen (my-desktop with my specific configuration),</li><li>double-click on it to edit the screen settings: we want to give the screen the name of our future Windows KVM, which for me will be my-windows.</li></ul><p>For a more dynamic setup, I also ticked the “Check clients every 5000ms” in the “Advanced server settings”. I also ticked “Use relative mouse moves”, which is useful for full-screen games to properly work with Synergy. Finally, I also set up a couple hotkeys to switch more easily between my screens:</p><ul><li>I set up the Ctrl+Shift+F1 hotkey to switchToScreen(my-windows),</li><li>the Ctrl+Shift+F12 hotkey to switchToScreen(my-desktop),</li><li>and the Ctrl+Shift+ScrollLock hotkey to lockCursorToScreen(toggle), to prevent my cursor from mistakenly leaving the current screen when I don’t want it to.</li></ul><p>To make sure other computers will be able to connect to Synergy, we have to add a rule to ufw, with the following command, to allow connections on port 24800 (the port used by Synergy):</p><pre>sudo ufw allow 24800</pre><p>Finally, I wanted Synergy to start on boot as a daemon, without the GUI visible for a more fluid experience: for that, we first have to save our settings as a configuration file, with the “File &gt; Save Configuration as…” menu. I saved it under ~/.synergy/synergy.conf.</p><p>Now we have our configuration file, we want to ask Ubuntu to start the synergy server as a daemon on boot. For that, we have to search for “Startup Applications” in the start menu. Here, we simply add a new application to start on boot, with the following setup:</p><ul><li>Name: whatever we want; I called it “Synergy”,</li><li>Command: synergys --config /home/[username]/.synergy/synergy.conf --enable-crypto (the s at the end of synergys is for server; don’t forget to replace username by your Ubuntu username),</li><li>Comment: whatever we want; I left it empty.</li></ul><p>Here we go! If we restart our computer and run the command ps -e | grep synergy, it should display a line containing synergys, which means the service is correctly configured and the Synergy daemon starts properly.</p><h4>Samba</h4><p><a href="https://www.samba.org/samba/what_is_samba.html">Samba</a> is a software that implements a network protocol to share files across computers, notably with Windows systems. Setting up a Samba server on Ubuntu allows us to mount a Ubuntu folder on the Windows KVM as a network drive.</p><p>To install samba, simply run the following in a Terminal:</p><pre>sudo apt-get install samba</pre><p>This will automatically setup our system to run the samba service on startup, so we do not have much more to do apart from configuring the server as we want. First, let’s configure ufw to open access to the samba daemon from other computers in our local network:</p><pre>sudo ufw allow from 192.168.0.0/24 to any app Samba</pre><p>Where 192.168.0.0/24 means any IP address of the form 192.168.0.XXX, which are the addresses assigned by my router.</p><p>The configuration file of samba is located at /etc/samba/smb.conf; I would recommend to write a backup file with the cp /etc/samba/smb.conf /etc/samba/smb.conf.bak, but if there is any problem there still remains a default configuration file at /usr/share/samba/smb.conf. For my setup, I added the following lines to my smb.conf file:</p><p>First, in the [global] section of the file:</p><pre>[global]<br>...<br># States that the server is part of the LOCALGROUP workgroup<br>workgroup = LOCALGROUP<br># Gives the name MY-DESKTOP to this server<br>netbios name = MY-DESKTOP<br># Makes sure the server will follow our symlink to ~<br>allow insecure wide links = yes</pre><p>The lines starting with a # are comments ignored by samba and only there to describe what each line does.</p><p>Finally, at the end of the file, after the [print$] group, let’s create a new shared folder on the Samba server called share:</p><pre>[share]<br># Just a comment to describe the shared folder<br>comment = Desktop Share Folder<br># The path on the Ubuntu system to share<br>path = /srv/samba/share<br># Typical configuration for a folder shared with Windows<br>available = yes<br># Replace username by the actual username on Ubuntu<br>valid users = [username]<br>read only = no<br>browseable = yes<br>public = yes<br>writable = yes<br># Makes sure the server will follow our symlink to ~<br>follow symlinks = yes<br>wide links = yes</pre><p>The specific configuration to allow Samba to follow symlinks comes from <a href="https://unix.stackexchange.com/questions/5120/how-do-you-make-samba-follow-symlink-outside-the-shared-path#137192">this answer</a>; because I have a symlink to ~ these lines are mandatory in my setup.</p><h4>VNC</h4><p><a href="https://en.wikipedia.org/wiki/Virtual_Network_Computing">VNC</a>, for <em>Virtual Network Computing</em>, is a convenient protocol for remote desktop access: it allows me to connect myself to my computer, viewing my screen and interacting with it remotely, which is great when I’m not home (especially, I can do that from my smartphone; cool stuff). Problem is, native VNC is not really good with encryption, so we are going to require <a href="https://en.wikipedia.org/wiki/Tunneling_protocol">SSH tunneling</a> to connect to our VNC server.</p><p>Ubuntu 16.04 LTS comes with an installed VNC server called Vino. It’s a pretty straightforward application with basic features. However, it is not easy to configure for a specific feature I do want: the ability to connect to my computer while still on the login screen. We hence are going to use <a href="https://help.ubuntu.com/community/VNC/Servers">x11vnc</a>, which is only slightly more complicated to configure. First, let’s install it:</p><pre>sudo apt-get install x11vnc</pre><p>Once installed, we want first to setup a password for a more secure handshake, with the following command:</p><pre>sudo x11vnc -storepasswd /etc/x11vnc.pass</pre><p>This will ask us for a password (twice), encrypt it and save it in the /etc/x11vnc.pass file.</p><p>Finally, we want to create a <a href="https://wiki.ubuntu.com/SystemdForUpstartUsers">systemd</a> service to automatically start x11vnc when the system boots. systemd is a software that manages efficiently the different services initiated when we boot Ubuntu. For that, let’s create a service file with the sudo vim /lib/systemd/system/x11vnc.service command for x11vnc. Here, click I to enter “Insert” mode and write the following configuration file:</p><pre>[Unit]<br>Description=Starts x11vnc server at startup<br>After=multi-user.target</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><pre>[Service]<br>Type=simple<br>ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared</pre><p>This script comes from <a href="http://c-nergy.be/blog/?p=8984">this blog post</a>. It will automatically execute the command written after ExecStart= at each startup, which will run the x11vnc server with authentication using the /etc/x11vnc.pass file and listening to port 5900.</p><p>Press “Escape” to leave “Insert” mode, then type :wq to write the file and quit vim. We now have our service script; all is left is to enable it. For that, let’s run:</p><pre>sudo systemctl enable x11vnc.service<br>sudo systemctl daemon-reload</pre><p>This will enable our script and reload the configuration to be properly loaded next time. After a quick reboot, the x11vnc server should start properly. We can check that the service is running with the sudo systemctl status x11vnc.service command.</p><p>To deny direct connections and make sure we use SSH tunneling, we really have nothing to do, except from making sure ufw is enabled. By default, it will deny connections on port 5900, which is the default port for the VNC protocol.</p><p>On Android, to connect to our VNC server through SSH tunneling, I use the free application <a href="https://play.google.com/store/apps/details?id=com.iiordanov.freebVNC&amp;hl=en">bVNC Free</a>:</p><ul><li>in Connection Type, choose Secure VNC over SSH,</li><li>in SSH Server, enter the IP address of the system, in our case 192.168.0.80,</li><li>in SSH Username, enter our Ubuntu username,</li><li>in SSH Password, enter our Ubuntu password (we can also generate a SSH public/private key pair),</li><li>in VNC Server, enter localhost,</li><li>in Port, enter 5900,</li><li>Finally, type the VNC password chosen after installing x11vnc in the appropriate field.</li></ul><p>We have to make sure the smartphone is connected to the same network as the computer for the connection to work (it must be connected to the router via WiFi). If the connection is successful, congrats! Everything works as intended.</p><p>For some explanation, we are here establishing a SSH connection to our computer (192.168.0.80) using our account credentials, then we create a tunnel though this SSH connection to the VNC server, which is available on port 5900 on the localhost address on the machine (localhost points out to the local machine). ufw denies connections on 5900 from outside the machine, but as we are already connected to the local machine through SSH on port 22 which we allowed earlier, we can connect to the port 5900 locally, from inside the machine.</p><h4>Wake On LAN</h4><p><a href="https://help.ubuntu.com/community/WakeOnLan">Wake On LAN</a> is a convenient feature allowing to wake up a computer remotely, by sending a specific network packet called “Magic Packet” to an Ethernet controller that will wake up the system. We can therefore switch on our computer remotely. This requires compatible hardware, but most recent motherboards with an integrated Ethernet controller are compatible with the Magic Packet.</p><p>We already set the Wake On LAN feature in the BIOS; now we have to do a little bit more configuration on Ubuntu to make sure everything works:</p><pre>sudo ethtool -s eth0 wol g</pre><p>Replacing eth0 by the name of the network interface; we can list the different interfaces with the ifconfig command to identify the name of the Ethernet controller. Once done, if we run the sudo ethtool eth0 command, we should see a line with Wake-on: g; if so, it means the command worked.</p><p>This was enough on my system to ensure Wake On LAN works consistently, however this previous command may be required after each boot; in that case, <a href="https://help.ubuntu.com/community/WakeOnLan">this Ubuntu help page</a> describes how to ensure it is executed at each boot.</p><p>My router allows me to send Magic Packets directly from its interface, that’s how I checked if the Wake On LAN was working; if that is not the case for you, you might want to use another software to test this feature.</p><h3>Chapter 5 — Installing Windows</h3><p>Here comes the tasty stuff. Running Windows 10 on a KVM. That sounds crazy. Is it?</p><p>Let’s start by installing <a href="https://help.ubuntu.com/community/KVM/VirtManager">Virtual Machine Manager</a> (virt-manager). It’s a nice GUI tool to manage virtual machines:</p><pre>sudo apt-get install virt-manager</pre><h4>Setting up OVMF</h4><p><a href="https://wiki.ubuntu.com/UEFI/OVMF">OVMF</a> is a virtual firmware designed to enable <a href="https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface">UEFI</a> support in virtual machines. UEFI is the modern version of the BIOS. To ensure maximal compatibility with Windows 10 and our GPU, this step is strongly advised, albeit not necessary.</p><p>For that, we need first to tell <a href="https://help.ubuntu.com/lts/serverguide/qemu.html">qemu</a> (the emulator behind virt-manager) where to find the OVMF specific files; to do that, open the qemu configuration file with sudo vim /etc/libvirt/qemu.conf and add the following lines to the file:</p><pre>nvram = [<br>        &quot;/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd&quot;<br>]</pre><h4>Installing Windows 10</h4><p>After buying a <a href="https://www.microsoft.com/store/d/Windows-10-Home/D76QX4BZNWK4/1NT3">Windows 10 license</a>, we can download an .iso file for the installer. Once we have it, start “Virtual Machine Manager” and click on “File &gt; New Virtual Machine”:</p><ul><li>Choose “Local install media (ISO image or CDROM)” and click “Forward”,</li><li>Click “Use ISO image:”, then “Browse…”; it will open the Virtual Manager Storage Volume management window, which we’ll see later on. Here, simply click “Browse Local” on the bottom of the window to locate the .iso file we downloaded, then click “Forward”,</li><li>Here, we have to choose how much RAM and cores we want to allocate to our KVM; I chose 16001 GiB of RAM and 6 CPUs out of 8 virtual cores,</li><li>Here we have to select the primary storage where we will install Windows 10; select “Select or create custom storage” and click on “Manage…”. Here, on the bottom-left corner, click the “+” sign. It will open a new window. Give a name to the storage (I chose windows-ssd) and select type “disk”, then click “Forward”. Here, in “Target path” select /dev, and in “Source Path” select the device name of our SSD, of the form /dev/sd#. In my case, it was /dev/sdb. I also had to check “Build pool”, as I did not use it at all when installing Ubuntu. It will add a new entry on the left (windows-ssd for me), click on it. Finally, next to “Volumes” on the right, click on the “+” sign, give the new volume a name and as much capacity as possible in the “Max Capacity” section. This will create a new partition on the disk ( /dev/sdb1 for me); double click on it to choose it then click “Forward”,</li><li>Finally, give a name to the KVM (I gave it my-windows); tick “Customize configuration before install” then click “Finish”,</li><li>This will be the virtual hardware configuration for the KVM; we want to use OVMF instead of the legacy SeaBIOS. For that, in “Overview”, choose in “Firmware” “UEFI x86_64 /usr/share/OVMF/OVMF_CODE.fd”, then click “Apply” to save the changes and finally “Begin installation” in the top-left corner to start the KVM and install Windows 10.</li></ul><p>This will configure the environment as described, and start the installation of Windows using the .iso file we specified. Simply follow the instructions; pay attention to give the same name to the Windows computer as we did when we set up Synergy (even though it’s quite easy to rename it in Synergy).</p><h4>Bridged network interface</h4><p>By default, <a href="https://help.ubuntu.com/lts/serverguide/libvirt.html">libvirt</a> (the software behind Virtual Machine Manager) creates a virtual network on the machine to which the guests connect to; however, that means our Windows system does not have access to our local network and cannot communicate to other devices. To overcome this problem, we must set up a <a href="https://help.ubuntu.com/community/NetworkConnectionBridge">bridge network interface</a>, which will in practice aggregate the virtual network with the local network to enable all machines on both ones to communicate seamlessly to each other.</p><p>To do that, in “Virtual Machine Manager”:</p><ul><li>Open “Edit &gt; Connection Details”,</li><li>Go to the “Network Interfaces” tab,</li><li>Click the “+” sign on the bottom-left corner,</li><li>In the new window, start by choosing “Bridge” in the “Interface type”, then press “Forward”,</li><li>In the “Name” field, give the interface a name (I gave it br0), then tick your Ethernet connection interface (eth0), then press “Finish”,</li><li>Finally, check that the “Start mode” for our newly created interface is set to “onboot”.</li></ul><p>That’s it for our bridged network interface. We now have to configure our KVM to use it instead of the default virtual network; for that, in “Virtual Machine Manager”, double click on my-windows (or whatever name you gave to your KVM), then click on the information icon on top of the window to display the virtual hardware configuration of the KVM. This is where we will have to update the setup whenever we want to optimize our system. Don’t forget to turn off the KVM before editing the configuration.</p><p>We want to change our Network Interface Controller, or NIC. Start by removing the existing one (right click &gt; “Remove Hardware”, no hard feelings), then click “Add hardware on the bottom-left corner. We want a “Network” hardware, with “Network source” set to “Bridge br0”. Check the “MAC address” and leave “Device model” to “Hypervisor default”, it works fine. Finally, press “Finish” to install the virtual hardware (if only it was that simple when I built my desktop).</p><p>Now let’s start the KVM to make sure the network is working as intended. After logging in to our desktop and waiting for the connection to establish, we can check if the computer is in the correct network by trying to ping our supervisor: open the command prompt in Windows (or a PowerShell) and run the following command:</p><pre>ping 192.168.0.80</pre><p>If the ping receives replies, we’re all set for the next steps!</p><p>One last thing we should do before going any further is to set a static IP address to this new system on our local network. As we did for Ubuntu, we can set a specific IP address to the Windows system by configuring the router; I chose to allocate the IP address 192.168.0.90 to my-windows.</p><h4>Connecting to Synergy</h4><p>Once the bridge network is working properly, connecting a Synergy client to our Synergy server is easy: from the Symless website, we simply have to go to the download page to download the Windows 64-bits installer, install it, select “Client” and fill the address field with the local IP address of our machine (in our case, 192.168.0.80), before pressing the “Start” button (or “Apply” if the client is already started). If the log shows a “NOTE: connected to server” line, that means it successfully connected to the Ubuntu server. On Windows, Synergy will start automatically at startup, so we do not have any additional configuration to do.</p><p>We should now be able to switch from Ubuntu to the Windows KVM simply by moving outside of the screen, following the configuration we chose when configuring the server. Be careful though, Synergy has a disturbing behavior with the KVM emulated window; if you click on the window, you will move your cursor in the Windows system, but as we did not enter it according to Synergy, we cannot leave it; we hence have to use the “Ctrl+Alt” key bind to leave the control of the KVM before entering it the Synergy way.</p><p>At the time of writing, there was one significant setback to using Synergy; as I am not a native English speaker, I have two keyboard layouts set up on my systems, and I use the “Alt+Shift” key bind to switch between them. The problem is, Synergy does not support switching between keyboard layouts from a client; it will always follow the layout of the server, so switching language requires me to move the cursor to the server screen before pressing “Alt+Shift”.</p><h4>Hardware performance optimization</h4><p>Before going any further, let’s optimize a bit our disk. If we run a disk read/write performance test, the results should be a bit disappointing for a SSD.</p><p>If we have a look at our virtual hardware list, we should have an “IDE Disk 1”. As you might know, IDE is an old and slow (for today’s standards) interface for connecting hard drives. Let’s trash that obsolete hardware and install a brand new SATA (the nice and not-so-recent blazing-fast interface your drive probably uses) disk: right click &gt; “Remove Hardware” on the IDE disk (don’t worry, we’re not losing Windows), then “Add Hardware”, select “Storage”, tick “Select or create custom storage”, in “Manage” select the partition on which you installed Windows, make sure “Device type” is set to “Disk device” and finally choose “SATA” for “Bus type”. In “Advanced options”, make sure “Cache mode” is set to “none” before pressing “Finish”.</p><p>With an IDE disk, I had read and write speed at about 350 MB/s; after switching to SATA, it skyrocketed up to 500–550 MB/s, which is similar to bare-metal performances.</p><p>I also changed a little bit my CPUs configuration: in CPUs, under “Topology”, I changed the default configuration of 6 sockets, 1 core, 1 thread to 1 socket, 6 cores and 1 thread; like that, instead of Windows seeing 6 CPUs with 1 core each, it will now see 1 CPU with 6 cores. It should be very similar in practice, but I felt more comfortable with that topology.</p><h4>Connecting to the Samba server</h4><p>Our KVM should not see our Samba server as is; the reason is we set up the server to use the workgroup LOCALGROUP, which is not the default one for a fresh Windows install. Let’s start by updating that:</p><ul><li>In the “Control Panel”, go to “System”,</li><li>Here, in the “Computer, name, domain, and workgroup settings”, click “Change settings” on the right,</li><li>Click then the “Change…” button as if we wanted to rename our computer,</li><li>In “Workgroup”, enter the name of the desired workgroup (LOCALGROUP for me).</li></ul><p>After a reboot to apply the changes, we should now see our MY-DESKTOP computer in the network (MY-DESKTOP being the name we gave in the netbios name of our /etc/samba/smb.conf file). We can also try to access it directly by typing \\MY-DESKTOP in the address bar of the Windows file explorer. If the Samba server is working correctly, we should see a share folder.</p><p>We are now going to mount it as a Windows drive; this way, it will be automatically mounted and integrated to our KVM’s filesystem. To do that:</p><ul><li>First, let’s go to “This PC” and right click anywhere &gt; “Add a network location”,</li><li>Press “Next” on the first screen,</li><li>Select “Choose a custom network location”,</li><li>Enter \\MY-DESKTOP\share\ or browse to the share location,</li><li>Give it a custom name and/or letter (I went for H: as in “home”).</li></ul><p>As I wanted to integrate my Windows environment into the Ubuntu one, I moved the different “My …” folders to this newly connected H: drive; here is how to do that:</p><ul><li>For each Windows location we want to customize (we are going to start with “Downloads” for the sake of the example), right click on it &gt; “Properties”,</li><li>In the “Properties” window, go to the “Location” tab,</li><li>The location should be the default Windows one; click the “Move…” button to change it,</li><li>Browse to the folder where you want to move the “Downloads” folder; I hence went for H:\[username]\Downloads.</li></ul><p>This setup requires us to wait a little bit when we start the Windows KVM for the connection to be established with the bridged network, before it can connect to the samba server and hence reconnect the H: drive.</p><h4>Fixing the audio</h4><p>Okay, now we should have a pretty nice set up. But if you try to listen to some music in the KVM, you will notice something really annoying: The sound is cracking, because the default virtualization setting is poorly optimized for sound processing.</p><p>The solution I found for this issue is anything but straightforward; after a lot of trial and error (and a couple <a href="https://en.wikipedia.org/wiki/Blue_Screen_of_Death">BSOD</a>), I finally managed to reach a setup that works with almost crystal-clear sound quality:</p><p>First, let’s download and extract the <a href="http://www.realtek.com.tw/downloads/downloadsCheck.aspx?Langid=1&amp;PNid=14&amp;PFid=23&amp;Level=4&amp;Conn=3&amp;DownTypeID=3&amp;GetDown=false">AC97 audio drivers</a>, the drivers we will need for the virtual sound card we are going to use, in any folder accessible by the Windows KVM. Now, shut down the KVM.</p><p>In a terminal, run the command:</p><pre>sudo virsh edit my-windows</pre><p>Where my-windows is the name of our Windows KVM; this opens the configuration file of our KVM, in a not-so-friendly format, where you can find all the parameters we set up for it. We need to change two things. First, we should replace the first line:</p><pre>&lt;domain type=&#39;kvm&#39;&gt;</pre><p>by</p><pre>&lt;domain type=&#39;kvm&#39; xmlns:qemu=&#39;<a href="http://libvirt.org/schemas/domain/qemu/1.0&#39;">http://libvirt.org/schemas/domain/qemu/1.0&#39;</a>&gt;</pre><p>Then, we need to add a couple lines at the end of the file, just before the &lt;/domain&gt; tag:</p><pre>...<br>  &lt;qemu:commandline&gt;<br>    &lt;qemu:env name=&#39;QEMU_AUDIO_DRV&#39; value=&#39;pa&#39;/&gt;<br>    &lt;qemu:env name=&#39;QEMU_PA_SAMPLES&#39; value=&#39;128&#39;/&gt;<br>    &lt;qemu:env name=&#39;QEMU_PA_SERVER&#39; value=&#39;/run/user/1000/pulse/native&#39;/&gt;<br>  &lt;/qemu:commandline&gt;<br>&lt;/domain&gt;</pre><p>This will use pulseaudio for our audio driver and more specifically connect it to the server run by our user, which has by default a uid=1000. To check what the specific uid of a specific user is, we can run the command id -u [username]. Once done, type :wq to save the configuration file.</p><p>Finally, we are going to change the sound controller of our KVM:</p><ul><li>Click &gt; “Remove Hardware” on the existing sound device,</li><li>Click “Add Hardware”,</li><li>Select “Sound” then “ac97” for the model.</li></ul><p>We can now start our machine with this brand new configuration. Sadly, the issue is not over yet; Windows 10 does not recognize automatically the “ac97” audio controller, so we have to install the drivers manually. To do that, we need first to disable driver signature enforcement from Windows to install these drivers:</p><ul><li>Open the settings and go to “Update &amp; security”,</li><li>In the “Recovery” tab, click the “Restart now” button below “Advanced startup”,</li><li>After the reboot, click “Troubleshoot”, “Advanced options” and “Startup Settings”,</li><li>Click the “Restart” button to restart once more,</li><li>Press “F7” to “Disable driver signature enforcement” then “Enter” to boot Windows 10.</li></ul><p>Finally, we can now install the “AC97” drivers:</p><ul><li>In the start menu, open “Device Manager”,</li><li>In “Other Devices”, there should be a “Multimedia Audio Controller”, which is our unrecognized audio controller; right click &gt; “Properties”,</li><li>In the “Driver” tab, click “Update Driver”,</li><li>Click on “Browse my computer for driver software”,</li><li>Click “Browse” and browse to the folder where the drivers were extracted, then click “Next”,</li><li>If everything goes as planned, this should install properly the “AC97” driver for the audio controller.</li></ul><p>We should now have a good sound quality with almost no distortion.</p><h4>Fixing the clock</h4><p>While we’re at it, let us fix the clock of our Windows KVM; by default, Windows uses UTC time, and systematically gets back to it after each reboot, which is inconvenient.</p><p>To make the KVM use local time setting instead, shut down the KVM, run again the virsh edit my-windows command and replace the line:</p><pre>&lt;clock offset=&#39;utc&#39;&gt;</pre><p>by</p><pre>&lt;clock offset=&#39;localtime&#39;&gt;</pre><p>Type :wq to save the configuration file. At the next boot, Windows should have the same time as the Ubuntu system.</p><h4>Wake On LAN, part 2</h4><p>As we did for our Ubuntu system, it would be great if we could also wake up our Windows KVM remotely with a Magic Packet, without having to go through the gruesome process of connecting to the Ubuntu machine to start it manually. The problem is, our KVM does not have an actual NIC, so we cannot configure it with the Wake On LAN technology; fortunately, there is a workaround.</p><p>Here comes the libvirt-wakeonlan script, <a href="https://github.com/simoncadman/libvirt-wakeonlan">available on GitHub here</a>. This is a python script that listens to packets received by the system, and if a packet is a Magic Packet, it will start the KVM the packet is trying to wake up. To install it, follow the instructions on the README.md file: first, open a Terminal, go to the folder of your choice (I went with ~/Documents) and run:</p><pre>git clone git://github.com/simoncadman/libvirt-wakeonlan.git</pre><p>This will create a new folder called libvirt-wakeonlan and copy the content of the remote repository in it. We then have to install it with:</p><pre>cd libvirt-wakeonlan<br>./configure make install</pre><p>Unfortunately, this will not work out of the box; this script is rather old, and not maintained anymore. It is configured to install this script as a service with the upstart init system, which has been replaced since Ubuntu 15.04 by systemd. We hence have to create ourselves the .service file to tell systemd to automatically run our script in the background.</p><p>For that, create a service file with the following command:</p><pre>sudo vim /lib/systemd/system/libvirt-wakeonlan.service</pre><p>Once the file is opened, write the following service configuration:</p><pre>[Unit]<br>Description=Starts KVM instances from wake on lan packets</pre><pre>[Service]<br>EnvironmentFile=/etc/systemd/libvirt-wakeonlan.conf<br>WorkingDirectory=/usr/local/share/libvirt-wakeonlan<br>ExecStart=/usr/local/share/libvirt-wakeonlan/libvirtwol.py $LIBVIRTDWOL_INTERFACE<br>Type=simple</pre><pre>[Unit]<br>Requires=libvirtd.service<br>After=libvirtd.service</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>As before, :wq to save the file. We also need to create a configuration file to setup our environment variables to make the script listen to the right interface:</p><pre>sudo vim /etc/systemd/libvirt-wakeonlan.conf</pre><p>In the configuration file, write the following:</p><pre>LIBVIRTWOL_INTERFACE=&#39;br0&#39;</pre><p>Where br0 should be replaced by the name of the bridged interface we chose before.</p><p>We now have to enable this script in systemd for it to start properly, with the following commands:</p><pre>sudo systemctl enable libvirt-wakeonlan.service<br>sudo systemctl daemon-reload</pre><p>After a reboot, the script should start as expected; we can check that with the command</p><pre>sudo systemctl status libvirt-wakeonlan.service</pre><p>Finally, we can check if Wake On LAN is working as expected, using the same method as we did for our Ubuntu system.</p><h4>Setting up the GPU</h4><p>This part is definitely the most complex of this setup, for multiple reasons:</p><ul><li>Modern GPUs are designed to be usable by the UEFI (the modern version of the BIOS), which requires it to be usable very early in the booting process of a computer,</li><li>Unlike most of the other components of a computer, a GPU cannot easily be shared across multiple systems, it is mostly bound to a system once claimed by one,</li><li>In addition, NVidia cards require specific configurations to bypass the infamous <em>Error 43</em> happening whenever it detects that it has been booted in a virtual environment.</li></ul><p>I hope you came armed with some time and patience. Let’s get on our way! First, let us activate <a href="https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit">IOMMU</a> on our system. For that, open the <a href="https://en.wikipedia.org/wiki/GNU_GRUB">grub</a> configuration file with sudo vim /etc/default/grub, and replace the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” by:</p><ul><li>GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash intel_iommu=on” with an Intel CPU,</li><li>GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash amd_iommu=on” with an AMD CPU.</li></ul><p>Grub is the <a href="https://en.wikipedia.org/wiki/Booting">bootloader</a> for Linux systems, which means it is the thing that will know what and when to load from our hard disk in order to start the operating system (in my case, Ubuntu). Even though the BIOS allows the use of IOMMU (it’s the VT-d / AMD-V thing we enabled in the first part of this post), will still have to tell the grub that Ubuntu can use it. Now, run sudo update-grub to update it with this new configuration, then reboot.</p><p>We can check that it worked correctly with the following commands:</p><ul><li>dmesg | grep -e &quot;Directed I/O&quot; with an Intel CPU, which should return DMAR: Intel(R) Virtualization Technology for Directed I/O,</li><li>dmesg | grep -e &quot;AMD-Vi&quot; with an AMD CPU, which should return something like:</li></ul><pre>AMD-Vi: Enabling IOMMU at XXXX:XX:XX.X cap XxXX<br>AMD-Vi: Lazy IO/TLB flushing enabled<br>AMD-Vi: Initialized for Passthrough Mode</pre><p>Now, we want to <em>prevent</em> Ubuntu from claiming our GPU, because we want to hold it for our Windows KVM. For that, we have to grab it with the <a href="https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Using_vfio-pci">vfio-pci</a> driver, a specific driver designed to pass PCI devices through a KVM. This is necessary for GPUs, as they cannot usually be shared between multiple systems.</p><p>To do that, we need first to get the ID of our GPU; first, let’s run the command lspci -nn | grep VGA. This should return something like:</p><pre>00:03.0 VGA compatible controller [0300]: Intel Corporation Device [8086:ZZZZ] (rev 04)<br>02:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:XXXX] (rev a1)</pre><p>The first line is the integrated graphics and the second the NVidia GPU, and the second line, starting with 02:. Because modern outputs carry both audio and video, our GPU has actually two controllers, one for the video and one for the audio. To get them both, run the lspci -nn | grep 02: command to get:</p><pre>02:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:XXXX] (rev a1)<br>02:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:YYYY] (rev a1)</pre><p>Note down, the 02:00.0 ID (which represents the physical location of the GPU), as well as both 10de:XXXX and 10de:YYYY IDs (which represents the GPU model).</p><p>Please note that the following procedure will only work if the GPU used by Ubuntu and by Windows are different.</p><p>We now want to tell the vfio-pci driver to grab this specific hardware. To do that, we need to modify two files:</p><ul><li>First, open sudo vim /etc/initramfs-tools/modules and add a line at the end of the file containing vfio-pci ids=10de:XXXX,10de:YYYY, replacing XXXX and YYYY by the IDs of the GPU,</li><li>Second, open sudo vim /etc/modules and add at the end of the file the following lines:</li></ul><pre># VFIO settings<br>vfio<br>vfio_iommu_type1<br>vfio_pci<br>vfio_virqfd<br>kvm<br>kvm_intel</pre><p>Replace the last line by kvm_amd with an AMD CPU.</p><p>This will tell the computer to load the vfio modules at boot time, and bind the devices to vfio-pci via the initramfs. Let’s update the latter before going further with the sudo update-initramfs -u command, then reboot.</p><p>Let’s check that vfio is now grabbing correctly the GPU with the dmesg | grep vfio:</p><pre>vfio-pci 0000:02:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=none<br>vfio_pci: add [10de:XXXX[ffff:ffff]] class 0x000000/00000000<br>vfio_pci: add [10de:YYYY[ffff:ffff]] class 0x000000/00000000<br>vfio-pci 0000:02:00.0: enabling device (0000 -&gt; 0003)</pre><p>If you have this last line, it means vfio-pci is correctly taking control of the GPU.</p><p>If this does not work, it may be because the NVidia driver (the nouveau driver by default on a Ubuntu system) grabs the GPU before vfio-pci. To check that, we can run the lspci -k, which should return something like that if the nouveau driver is in use:</p><pre>02:00.0 VGA compatible controller: NVIDIA Corporation Device XXXX<br>        Kernel driver in use: nouveau</pre><p>To force the system to use the vfio-pci driver, we can blacklist the NVidia driver in the grub configuration to ensure it does not grab the GPU before vfio-pci; to do that, open once again the grub configuration file with sudo vim /etc/default/grub and replace:</p><pre>GRUB_CMDLINE_DEFAULT=&quot;quiet splash intel_iommu=on&quot;</pre><p>by</p><pre>GRUB_CMDLINE_DEFAULT=&quot;modprobe.blacklist=nouveau quiet splash intel_iommu=on&quot;</pre><p>Don’t forget to replace intel_iommu=on by amd_iommu=on for an AMD CPU; I do not know the equivalent of modprobe.blacklist=nouveau for an AMD GPU, so you will have to find by yourself if need be.</p><p>Once done, update the grub configuration with sudo update-grub, then reboot and check if vfio-pci now correctly grabs the GPU.</p><p>Unfortunately, it’s far from over! We need to tweak a little bit our KVM configuration file for the GPU to work properly. Run sudo virsh edit my-windows and between the &lt;qemu:commandline&gt; tags we added earlier for the audio, add the following lines:</p><pre>&lt;qemu:commandline&gt;<br>  ...<br>  &lt;qemu:args value=&#39;-cpu&#39;/&gt;<br>  &lt;qemu:args value=&#39;host,kvm=off,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_vendor_id=1234567890ab&#39;/&gt;<br>&lt;/qemu:commandline&gt;</pre><p>This adds specific parameters to our KVM to ensure maximum compatibility with modern GPUs. I do not know exactly what each one of them does, nor which one are specifically required. It comes from this <a href="https://www.reddit.com/r/VFIO/comments/479xnx/guests_with_nvidia_gpus_can_enable_hyperv/">Reddit post</a>, as well as multiple other resources online about VGA pass-through.</p><p>We can now add the GPU to our KVM. In Virtual Machine Manager, open our “my-windows” KVM virtual hardware details, click on “Add hardware”, go to “PCI Host Device” and select the video part of our card (0000:02:00.0 in our case). Don’t add the audio part for now; we still have some workarounds to do.</p><p>With a recent NVidia GPU (1000 series), if we try to bind the GPU to our KVM, it will effectively recognize it as our actual GPU (NVidia GTX 1060 6 GB for me), but it will throw an Error 43. That’s because when the GPU is normally booted, it flashes a modified version of its own vBIOS (video BIOS) before being accessible; as we did not boot it normally, it does not recognize the expected vBIOS and returns this error.</p><p>If it works like that for you, ignore the following steps, and directly add the audio part to the KVM as we did for the video part above.</p><p>To overcome this problem, we have to extract this vBIOS from our GPU. To do that, follow the following steps:</p><ul><li>Run echo &quot;0000:02:00.0&quot; | sudo tee /sys/bus/pci/drivers/vfio-pci/unbind, where 02:00.0 is the ID of our GPU to unbind it from the vfio-pci driver,</li><li>Run:</li></ul><pre>echo 1 | sudo tee /sys/bus/pci/devices/0000:02:00.0/rom<br>sudo cat /sys/bus/pci/devices/0000:02:00.0/rom &gt; ~/gpu_vbios.rom<br>echo 0 | sudo tee /sys/bus/pci/devices/0000:02:00.0/rom</pre><p>This will make the ROM of our GPU readable, extract it to the ~/gpu_vbios.rom file, and then turn it back to normal.</p><ul><li>Finally, rebind the GPU to vfio-pci with the echo &quot;0000:02:00.0&quot; | sudo tee /sys/bus/pci/drivers/vfio-pci/bind command.</li></ul><p>This solution was suggested in <a href="https://www.reddit.com/r/VFIO/comments/5sh41p/any_other_reasons_for_nvidia_driver_code_43/">this Reddit post</a> and this <a href="https://medium.com/@calerogers/gpu-virtualization-with-kvm-qemu-63ca98a6a172">Medium post</a>. Now we have the driver, we can modify once again the configuration file of our KVM to point to that file, using the sudo virsh edit my-windows command. In the file, there should be a section looking like that:</p><pre>&lt;hostdev mode=&#39;subsystem&#39; type=&#39;pci&#39; managed=&#39;yes&#39;&gt;<br>  &lt;source&gt;<br>    &lt;address domain=&#39;0x0000&#39; bus=&#39;0x02&#39; slot=&#39;0x00&#39; function=&#39;0x0&#39;/&gt;<br>  &lt;/source&gt;<br>  &lt;address type=&#39;pci&#39; domain=&#39;0x0000&#39; bus=&#39;0x00&#39; slot=&#39;0x07&#39; function=&#39;0x0&#39;/&gt;<br>&lt;/hostdev&gt;</pre><p>We need to add a new line between the &lt;hostdev&gt; tags to tell libvirt where to find our ROM, as follow:</p><pre>&lt;hostdev mode=&#39;subsystem&#39; type=&#39;pci&#39; managed=&#39;yes&#39;&gt;<br>  &lt;source&gt;<br>    &lt;address domain=&#39;0x0000&#39; bus=&#39;0x02&#39; slot=&#39;0x00&#39; function=&#39;0x0&#39;/&gt;<br>  &lt;/source&gt;<br>  &lt;rom file=&#39;/home/[username]/gpu_vbios.rom&#39;/&gt;<br>  &lt;address type=&#39;pci&#39; domain=&#39;0x0000&#39; bus=&#39;0x00&#39; slot=&#39;0x07&#39; function=&#39;0x0&#39;/&gt;<br>&lt;/hostdev&gt;</pre><p>Don’t forget to replace [username] by the Ubuntu username.</p><p>Unfortunately, this does not work yet; qemu does not manage to access the ROM because it does not have the correct access rights. We therefore need to modify the qemu configuration file with sudo vim /etc/libvirt/qemu.conf, and add the following lines:</p><pre>user = &quot;+0&quot;<br>group = &quot;+0&quot;<br>cgroup_device_acl = [<br>      &quot;/dev/null&quot;, &quot;/dev/full&quot;, &quot;/dev/zero&quot;,<br>      &quot;/dev/random&quot;, &quot;/dev/urandom&quot;,<br>      &quot;/dev/ptmx&quot;, &quot;/dev/kvm&quot;, &quot;/dev/kqemu&quot;,<br>      &quot;/dev/rtc&quot;,&quot;/dev/hpet&quot;, &quot;/dev/vfio/vfio&quot;,<br>      &quot;/dev/vfio/1&quot;<br>]<br>security_driver = &quot;none&quot;<br>security_default_confined = 0<br>relaxed_acs_check = 1</pre><p>This will basically grant root permission to qemu in order to be able to read the ROM file. This solution comes from <a href="https://bbs.archlinux.org/viewtopic.php?pid=1438076#p1438076">this post</a> from the Arch Linux forum. Save and reboot.</p><p>Now we can finally add the audio part of our GPU to our KVM via the “Add hardware” button, and run the KVM to check if <strong>it now works correctly</strong>!</p><p><strong>Hooray!</strong></p><p>We can now enjoy Ultra settings in our KVM for a smooth gaming experience.</p><h4>Setting up USB hot-swap</h4><p>There is one last thing to set up for our Windows KVM to be as user-friendly as can be: USB hot-swapping. Whenever we start the KVM, only preset hardware is passed to the virtual machine; which means we have to restart the VM if we want to attach a new device. This is annoying, because we are now used to hot-swapping, notably for USB devices, which means we can plug something in our computer and it will recognize it and let us use it immediately.</p><p>There is a way to simulate that behavior in our KVM. Whenever a USB device is plugged in in a port we want to pass through, a daemon called udev will see that the hardware configuration changed. It is therefore possible to register handlers to act upon specific events. In our case, we want, whenever a device is plugged in or out, to dynamically add or remove the device to the XML configuration of our KVM.</p><p>Fortunately, there is already a script written to do just that: <a href="https://github.com/olavmrk/usb-libvirt-hotplug">usb-libvirt-hotplug</a>. To make it work, we first have to clone the repository containing the shell script on our system — I myself downloaded it in</p><pre>/home/[username]/usb-libvirt-hotplug/usb-libvirt-hotplug.sh</pre><p>Then, to make udev behave as expected, we need to add additional rules to its configuration. but first, we need to identify the device path of the ports we want to pass through. To do that, we need to run the command</p><pre>udevadm monitor --property --udev --subsystem-match=usb/usb_device</pre><p>This will display an event whenever a USB device is plugged in or out. Then, we plug any USB device in the ports we want to pass through. There will be an event appearing containing the following lines:</p><pre>UDEV  [XXXXXX.XXXXXX] bind     /devices/pci0000:00/0000:00:aa.b/usb1/c-dd (usb)<br>ACTION=bind<br>BUSNUM=00c<br>...</pre><p>The format might be slightly different, notably if you are plugging the device in a USB hub rather than directly on the computer. Then, we need to add additional rules to our udev daemon to automatically call the script usb-libvirt-hotplug.sh whenever a device is plugged in. To do that, we edit the file</p><pre>sudo vim /etc/udev/rules.d/usb-libvirt-hotplug.rules</pre><p>And add the following lines for each port we want to handle:</p><pre>SUBSYSTEM==&quot;usb&quot;,DEVPATH==&quot;/devices/pci0000:00/0000:00:aa.b/usb1/c-dd&quot;,RUN+=&quot;/home/[username]/usb-libvirt-hotplug/usb-libvirt-hotplug.sh my-windows&quot;<br>SUBSYSTEM==&quot;usb&quot;,DEVPATH==&quot;/devices/pci0000:00/0000:00:aa.b/usb1/c-dd/*&quot;,RUN+=&quot;/home/[username]/usb-libvirt-hotplug/usb-libvirt-hotplug.sh my-windows&quot;</pre><p>Now, every time a USB device is plugged in one of the passed through ports, the script will run and will add the device to the KVM config of my-windows.</p><h3>Conclusion</h3><p>The road to a KVM is most definitely a long one filled with hurdles; but if you plan on setting one up for yourself, do not give up! It <strong>does</strong> work. If you are stuck on the way, don’t forget that Google Is Your Friend. You can also ask away in the comments if you have questions, even though there are much more skilled people on internet who could probably give you better answers that I could (skilled people without whom I would never have managed to set it all up myself).</p><p>I wanted also to credit my amazingly patient girlfriend, who supported me throughout the long process of trials and errors that led me to this now working desktop.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=937ef77d9103" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[1/2] From Amazon to Windows 10 on a KVM]]></title>
            <link>https://medium.com/@skasch/1-2-from-amazon-to-windows-10-on-a-kvm-6adddfe57719?source=rss-b7c684c47aba------2</link>
            <guid isPermaLink="false">https://medium.com/p/6adddfe57719</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[kvm]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Romain Mondon-Cancel]]></dc:creator>
            <pubDate>Tue, 29 Aug 2017 18:30:02 GMT</pubDate>
            <atom:updated>2017-08-29T18:30:02.743Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part one — from Amazon to a running computer</h4><h3>How it all started</h3><p>I have had a <a href="https://help.ubuntu.com/community/WindowsDualBoot">dual boot</a> for quite some time, as many of us do. It is always convenient to have a Linux-based OS for flexibility, especially when we are regularly coding stuff. But as a gamer, I find myself almost always running the Windows partition, and end up coding on Windows instead (ugh).</p><p>As my current laptop is dying after an unfortunate yet frustrating mechanical rupture of the LCD display holding structure, I realized it was well past time I updated my setup. My previous laptops often fell short of my expectations regarding their life expectancy, so I decided I would rather build a desktop. I would put more money into it, with the expectation that it would last significantly longer and, in the end, turn out to be a better investment.</p><p>A new desktop is the perfect excuse for some nerdy experimentation. Incidentally, a friend told me recently about this magical thing called <a href="https://www.linux-kvm.org/page/Main_Page">KVM</a>. It’s apparently a <a href="https://en.wikipedia.org/wiki/Virtual_machine">VM</a> (Virtual Machine) with seamless access to hardware components through <a href="https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit">IOMMU</a>. Albeit not expert enough to understand in details how does such a technology work, I get that it makes for a VM with almost bare-metal performance. Which means I can have a Linux-based and a Windows-based machine working concurrently on the same desktop with good performance for both, which is an appealing concept.</p><h4>What I want my computer to do</h4><p>The first and foremost feature I want is to be able to run Windows and Linux at the same time on the same computer. But what for? Here are the different things I would like to be able to do with that kind of setup:</p><ul><li>Having a 24/7 Linux-based machine running on my local network, offering different services to the other machines, notable a <a href="https://symless.com/synergy">Synergy</a> server for mouse and keyboard sharing and a <a href="https://www.samba.org/samba/what_is_samba.html">Samba</a> server for file sharing,</li><li>Setting up remote access to my Linux system through <a href="https://en.wikipedia.org/wiki/Virtual_private_network">VPN</a> on my router using <a href="https://openvpn.net/">OpenVPN</a>, with <a href="https://en.wikipedia.org/wiki/Secure_Shell">SSH</a> access and <a href="https://en.wikipedia.org/wiki/Virtual_Network_Computing">VNC</a> through <a href="https://en.wikipedia.org/wiki/Tunneling_protocol#Secure_Shell_tunneling">SSH tunneling</a>,</li><li>Setting up <a href="https://en.wikipedia.org/wiki/Wake-on-LAN">Wake On LAN</a> for both my Linux and Windows systems,</li><li>Using <a href="https://www.nvidia.com/en-us/shield/games/gamestream/">NVidia GameStream</a> to play on my TV from the Windows system (and ideally, from anywhere in the world; talking about portability).</li></ul><p>In this first part, I will describe how I built my computer and installed <a href="https://www.ubuntu.com/">Ubuntu</a> 16.04 LTS on it.</p><h3>Chapter 1 — A brand new setup</h3><p>I wanted to go with a gaming setup, with a reasonable budget of about 1,600€, with extra-RAM to run smoothly two concurrent OSes. Here is my shopping list:</p><ul><li>[Case] Cooler Master Force 500 (48€)</li><li>[PSU] Textorm TX600M+ 600 W (58€)</li><li>[Motherboard] MSI Z270-A PRO (106€)</li><li>[CPU] Intel Core i7–7700K 4.2 GHz (327€)</li><li>[Cooling] be Quiet! Pure Rock (33€)</li><li>[Paste] ARCTIC MX-4 4g (5€)</li><li>[RAM] G.Skill 16 GB + 8 GB DDR4 2400 MHz (205€)</li><li>[SSD] Samsung EVO 850 500 GB (150€)</li><li>[HDD] Toshiba P300 2 TB (70€)</li><li>[GPU] Gigabyte GeForce GTX 1060 G1 6 GB (315€)</li></ul><p>With a couple additional accessories and software:</p><ul><li>[Mouse] Logitech MX Master (63€)</li><li>[Keyboard] Logitech K800 (78€)</li><li>[USB key] QUMOX 32 GB (9€)</li><li>[Adapter] Mounting frame 2.5&quot;-3.5&quot; (2x 6€)</li><li>[Fans] be Quiet! Pure Wings 2 120 mm (2x 10€)</li><li>[Card reader] ICY BOX 3.5&quot; multi card reader (25€)</li><li>[OS] Windows 10 Family Edition (135€)</li><li>[Keyboard sharing] Synergy Pro (26€)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oUAdL9xI4rmzCcc18GaZw.jpeg" /><figcaption>My shopping list, apart from the GPU and the PSU.</figcaption></figure><p>This setup adds up to a total of 1,685€, slightly above my target. I saved a couple dozen euros waiting for Amazon to suggest lower prices for the most expensive elements (though I probably could have saved even more); I already have a monitor, so I did not need to buy one, this would have brought the total price up to about 1,800€ with a simple full HD monitor.</p><h4>Fans and PSU</h4><p>Regarding fans in general, we want to first decide which way we want the air to flow through the case. In most setup, the air flows from the front towards the back; one might wants to choose otherwise, but in the end it doesn’t even matter. What really matters however, is to make sure all our fans are facing the same direction: either all sucking from the front towards the back, or the other way around. I personally chose the former.</p><p>Let’s start by customizing a little bit our case, setting up the couple of 120 mm fans in the front for a better ventilation. After taking off the front of the case (there was a handle underneath), I started screwing in my two 120 mm fans. I would recommend passing the fans power cables on the right when you look at the front of the case, this way they will pass behind the 3.5&quot; bays.</p><p>Let’s now install the <a href="https://en.wikipedia.org/wiki/Power_supply_unit_(computer)">PSU</a> (Power Supply Unit), the power provider of our computer. I would recommend installing it so that the fan is facing upwards if it is mounted on the top of the case and downwards if it is at the bottom of the case: this way, it will suck fresh air from outside for a more efficient cooling. There is not much more to say about it, just make sure it is tightly screwed to the case.</p><h4>The motherboard and CPU</h4><p>Here comes the central part of our computer: the <a href="https://en.wikipedia.org/wiki/Motherboard">motherboard</a>. It’s this thing that will connect all the elements of our computer together, making sure they can effectively communicate to each other. Let’s start by removing both sides of our case and screw the supporting screws for our motherboard. Follow the case instructions to make sure to screw the right ones.</p><p>Generally speaking, choosing a computer with fixed budget is a trade-off between portability and flexibility; a smaller setup will comes at the cost of a more constrained build, with fewer ports, less powerful hardware (especially the GPU), less efficient cooling. When choosing our setup, this is an important question to ask ourselves: does the size of the desktop matter? Laptops (especially notebooks) are typically the extreme version of choosing portability over flexibility.</p><p>Motherboards come in different sizes, which are technically called <a href="https://en.wikipedia.org/wiki/Form_factor_(design)">form factors</a>: the typical large one is the <a href="https://en.wikipedia.org/wiki/ATX">ATX</a> format, which is a bit large but comes with the most connectors for better flexibility. The micro-ATX is a more compact mainstream alternative, which we would rather choose would we want to have a smaller computer. Because I wanted a rather unconstrained setup, I chose an ATX motherboard, which is the reason why I had to choose a medium-size case. There still exists larger case, but it remains a pretty large one which cannot be easily transported and is not meant to be moved around.</p><p>Before anything, we need to set up the <a href="https://en.wikipedia.org/wiki/Central_processing_unit">CPU</a> (Central Processing Unit) in its case on the motherboard. The CPU is the very core of a computer: it’s the thing that computes all the elemental operations required for the computer to run. Please be careful with this step: a CPU is a small but expensive piece of hardware, and we do not want to damage it.</p><p>First, press and move right the metal handle holding down the CPU case on the motherboard, then lift it up. Now, put the CPU in place, while making sure to orient it as shown in the CPU and motherboard manuals; there was in my case a small triangle in the bottom-left corner for that. Now we can close the case. It is a bit tight, on purpose: we absolutely don’t want the CPU to move when the computer is running. Remove the plastic protection on top of the case afterwards.</p><p>Before installing the motherboard in the case, we first want to set up the metal plate holding the back panel connectors. We will have to push the motherboard against the plate to screw it to the motherboard; be cautious with the motherboard, but don’t hesitate to push it to align the holes. We can now screw the motherboard to the case. Be careful here: do not screw tightly the motherboard, this would damage it. On the contrary, as soon as the screw is touching the motherboard, stop right there and leave it like that.</p><h4>CPU cooling</h4><p>The CPU is the component that warms up the most (with the GPU) in a computer. It is essential to provide it with a proper and efficient cooling system. <a href="https://en.wikipedia.org/wiki/Water_cooling#Computer_usage">Water-cooling</a> has been quite popular among gamers for its good cooling performance, low noise and great look with LEDs and stuff. But I still prefer a more classic <a href="https://en.wikipedia.org/wiki/Air_cooling#Electronics">air cooling</a> system, what we call in France a <em>ventirad</em>, which is a big metal structure (the <a href="https://en.wikipedia.org/wiki/Heat_sink">heat sink</a>) to extract the CPU heat with a fan to dissipate it. Setting up the ventirad is the last step that requires careful attention.</p><p>Around the CPU, we can see four holes in a square disposition. We will use them to setup the support that holds our heat sink. If we look at the cooling fan manual, there should be instructions describing how to setup the holding plate behind motherboard through these holes. We just have to screw it as instructed.</p><p>After that, before going any further, let’s first check how we will set it up: we want the heat sink oriented left-right, with the fans eventually fixed on the right of it. Once we know how to do that, let’s start screwing the structure to hold the heat sink until we are ready to set it up on the CPU. Now is the time to use our <a href="https://en.wikipedia.org/wiki/Thermal_grease">thermal paste</a>. We want to spread the paste all over the surface of the CPU to maximize thermal transfer, but with the thinnest possible layer to ensure maximal efficiency. It is a tough step to do perfectly: I have been quite generous with the paste, I probably should have used less than what I did. After making sure there is no dust on the CPU, start spreading.</p><p>Once we are satisfied with our layer of thermal paste, let’s install the heat sink on it: make sure to squeeze the thermal paste against the CPU for maximal surface of contact, without overdoing it. That leaves us with the CPU fan to install (if it’s not already fixed to the heat sink), and we’re done with our CPU!</p><h4>Hard drives</h4><p>Let’s proceed with our <a href="https://en.wikipedia.org/wiki/Hard_disk_drive">HDD</a> (Hard Disk Drive) and <a href="https://en.wikipedia.org/wiki/Solid-state_drive">SSD</a> (Solid-State Drive) installation. Those are the long-term memory of the computer, the place where it can store persistently files and data. The main practical difference between SSD and HDD is that the former will be faster with blazing fast read/write speeds, at the cost of being more expensive. Most modern cases have plastic holders to quickly install drives. If you don’t, don’t forget your screwdriver.</p><p>This step is usually very simple and quick. We just have to remove the plastic holders on both sides, slide our drives it the desired bay (I always fill them from top to bottom) with the plugs oriented towards the motherboard, and finally put the holders back (or screw it to the bay if we do not have those plastic holders).</p><p>I did a mistake that made me lose some time: when using an adapter to install a 2.5&quot; drive in a 3.5&quot; bay, make sure to first screw the 2.5&quot; drive to the adapter before sliding the adapter in the bay.</p><p>The process is also the same for any external drive we want to setup; I myself installed a 3.5&quot; external multi-card reader, in addition to my 3.5&quot; 2 TB hard drive and my 2.5&quot; 500 GB SSD.</p><p>Now the hard drives are installed, we won’t need to access the back of our motherboard anymore; let’s close the right side of the case.</p><h4>RAM and GPU</h4><p>These are the last pieces of hardware we need to setup. <a href="https://en.wikipedia.org/wiki/Random-access_memory">RAM</a> (Random Access Memory) is the short-term memory of the computer, the place where programs can store temporary data to run properly; RAM is meant to be accessed very quickly by the computer and more specifically by the CPU, with very fast read/write speed and low latency.</p><p><a href="https://en.wikipedia.org/wiki/Graphics_processing_unit">GPU</a> (Graphics Processing Unit) is a piece of hardware dedicated to computing graphical data; it has a specific design to be able to compute very efficiently the mathematical operations required to render the successive images displayed by the computer, which requires the ability to manipulate high-dimensional vectors and matrices. Apart from some <a href="https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units">more specific uses</a>, the GPU is mostly important in games, where a better one will allow for enhanced graphics and a more fluid <a href="https://en.wikipedia.org/wiki/Frame_rate">frame rate</a>.</p><p>The RAM modules go into these long plugs called DIMM slots. Motherboards typically have a preferred order to fill them, please refer to the motherboard manual to be sure where to install the first modules. Before we can install them, we need to open the slots by pushing the plastic holders on both ends of each slot. Once opened, align the module (specifically the little nick on the modules) with the slot and start pushing it downwards, while slightly pulling the holders back at the same time to help engage the modules.</p><p>Finally, let’s install the GPU. If the motherboard has one, it’s better to install it on a reinforced PCI slot, as they tend to be large and heavy; this would increase its durability.</p><p>Take the GPU, remove the metal plates on the back panel in front of the PCI slot where we will plug it in, press the plastic holder at the right side of the PCI slot, then proceed to insert the GPU in it, while slightly pulling back the holder, in a similar fashion as for the RAM modules. Do not forget to remove the plastic caps on your GPU if there are some.</p><p>There usually are holes on the back panel of the GPU to screw it to the back of the case. If so, screw it: the GPU will be more tightly mounted, which is important for such a heavy piece of hardware.</p><h4>Plugging everything together</h4><p>The last step before we can turn on our computer is to plug everything to the motherboard. I would recommend to start with all the wires coming from the front: as there should be many of them, it’s a good idea to start with them to avoid any cable mess. Please refer to the motherboard documentation to know exactly where the different connectors are.</p><p>The most annoying wires to plug are the front panel header connectors, which include HDD and power LEDs, as well as the power and reset switches. They should be gathered together in an 8-pins shape; it is more convenient to plug them one after the other. Be careful to plug them all in the right pins, following the motherboard manual. On mine, they had to be plugged in the JFP1 pins.</p><p>I would go next with the audio, fans and USB. USB3 connectors (called JUSB3~4 on my motherboard) are quite hard to plug in, we should absolutely make sure the pins are oriented correctly (identify the missing pin) before plugging them in. Next, I would plug the audio HD and the USB2 in (on my motherboard, into respectively JAUD1 and JSUB1~2). Next are the case and CPU fans: there are three pins and four pins models, for respectively DC and PWM power control. They both fit into the four pins plugs on the motherboard. If you need to install a three-pin connector, align it with the small plastic holder along the connector to plug it in correctly. I plugged the case fans into SYS_FAN1~3 and the CPU fan into CPU_FAN1.</p><p>It is quite easy to incorrectly plug these different connectors: do not hesitate to double check that the connectors are correctly facing the pins. Specifically, it often happens that a connector is shifted one pin to the side, with a few pins not inserted inside the connector.</p><p>Let’s install now our power cables: first, make sure the PSU is unplugged and turned off. There should be first two main power connectors for the motherboard: an 8-pins one to power the CPU and a 24-pins one to power the rest of the board. We have to plug them both for our motherboard to work properly. On mine, the connectors are called CPU_PWR1 and ATX_PWR1.</p><p>We then have to connect our drives. They actually require two connectors: one from the PSU, a large and flat one, which is a SATA power connector, and one to the motherboard, a shorter one, the SATA data connector. With a modular or semi-modular PSU, there should be a cable to plug to the PSU with the proper SATA power connectors. Plug the power connector before the data connector. With a right angle SATA cable, it is recommended to plug the right angle to the drive for better cable management.</p><p>In addition, most GPUs also require a specific power supply (mine required an 8-pin connector); if so, add a cable from the PSU to the GPU with the right connector to supply it with power.</p><p>Finally, a little bit of cable management cannot hurt: with a couple cable ties in hand, grab together cables that are close to each other and tie them together for a cleaner layout. I tied together the power cables from my PSU and the numerous cables coming from the front panel.</p><h3>Chapter 2 — BIOS setup</h3><p>Now that the system is starting properly, let’s set up a couple things in the <a href="https://en.wikipedia.org/wiki/BIOS">BIOS</a> of the motherboard. The BIOS is a basic system installed on the motherboard to allow for some basic configuration and control. To access it, there should be a key bind displayed in the boot screen; for me, it was the “Del” key. Modern BIOS (called <a href="https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface">UEFI</a>) have USB and mouse support, which makes it more convenient and user-friendly. After checking that the motherboard recognizes every piece of hardware installed to make sure everything is plugged and working correctly, I tweaked a couple things:</p><ul><li>My two 120 mm front fans have PWM connectors to adapt their speed, while the motherboard uses DC control by default; I changed my BIOS settings to use PWM control instead with them,</li><li>The RAM modules were recognized as running at 2133 MHz by the motherboard, while they were supposed to run at 2400 MHz; I hence updated their clock speed to 2400 MHz,</li><li>I also activated <a href="https://www.intel.com/content/www/us/en/gaming/extreme-memory-profile-xmp.html">XMP</a> to improve performances.</li></ul><p>There were also a couple of features to enable that we will need afterwards:</p><ul><li>Enable <a href="https://software.intel.com/en-us/articles/intel-virtualization-technology-for-directed-io-vt-d-enhancing-intel-platforms-for-efficient-virtualization-of-io-devices">Intel VT-d</a> (it’s called <a href="http://www.amd.com/en-gb/solutions/pro/virtualization">AMD-V</a> for AMD CPUs) for my CPU, to enable the computer to use the IOMMU technology, which I found under “OC &gt; CPU Features &gt; Intel VT-d tech” on my motherboard,</li><li>Enable Wake On LAN, to ensure the integrated Ethernet controller would be able to listen to the network even when the motherboard is turned off, which was under “Settings &gt; Advanced &gt; Wake Up Event Setup &gt; Resume By PCI-E Device”.</li></ul><p>Finally, as we want to dedicate the GPU to Windows, we probably want to boot with the Integrated Graphics Display (IGD) for Ubuntu; on my motherboard, this option was found under “Settings &gt; Advanced &gt; Integrated Graphics Configuration”.</p><p>Once this is all done, save and reboot the machine.</p><h3>Chapter 3 — Installing Ubuntu</h3><p>Because I am lazy and used to it, I decided to install <a href="https://www.ubuntu.com/">Ubuntu</a> 16.04 LTS as my primary OS. To do that, I downloaded <a href="https://unetbootin.github.io/">UNetbootin</a> on another computer, plugged in the USB drive, chose the Ubuntu 16.04 LTS 64 bits distribution and installed it on the said USB drive.</p><p>Once the bootable USB key ready, simply plug it in the newly built desktop and turn it on. This will boot the system from the USB drive and ask if we want to install Ubuntu (we do). After a couple easy steps (keyboard layout and stuff), the installer will ask if we want a custom install (we do). I wanted to choose myself my partitioning layout, especially to dedicate my 500 GB SSD to Windows, so I installed it on my 2 TB HDD with the following setup:</p><ul><li>/dev/sda1 50 GB ext4, mount point /, for the Ubuntu system,</li><li>/dev/sda2 8 GB swap, for <a href="https://en.wikipedia.org/wiki/Paging#Swap_files_and_partitions">swap memory</a>,</li><li>/dev/sda3 500 GB ext4, mount point /srv/samba/share, for a shared folder on my local network,</li><li>/dev/sda4 1.44 GB ext4, mount point /home, for my home documents.</li></ul><p>Booting on /dev/sda and leaving /dev/sdb (the SSD) unused. Once confirmed, this should smoothly install Ubuntu. If it warns about some UEFI stuff, don’t worry about it.</p><p>After doing it, I realized it was not optimal: I should have set the / and /home partitions next to each other, to ensure I can easily resize the partitions if need be. Or better yet, I should have used <a href="https://wiki.ubuntu.com/Lvm">LVM</a> for a more dynamic setup.</p><p>Because I want direct access to the /home/username folder from my Samba share, I added a symlink /srv/samba/share/username -&gt; /home/username, where username is the name I chose for my account. This will allow me to also share my home documents across the local network.</p><h3>Next steps</h3><p>This was the first part of the story about how I built and set up my brand new desktop. The second parts details how I configured the computer to enable the different features I want: keyboard and mouse sharing, file server, and most importantly the Windows KVM itself. You can find the second part of this story <a href="https://medium.com/p/937ef77d9103">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6adddfe57719" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>