Skip to content

Commit abf9694

Browse files
committed
Initial commit
0 parents  commit abf9694

File tree

7 files changed

+595
-0
lines changed

7 files changed

+595
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.hugo_build.lock
2+
public/
3+
resources

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/re-terminal"]
2+
path = themes/re-terminal
3+
url = [email protected]:mirus-ua/hugo-theme-re-terminal.git

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 blinxen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: Fedora i3 VM setup on Windows 11 using Hyper-V
3+
date: 2025-09-17
4+
---
5+
6+
Recently a thought came to my mind. We live in the year 2025, virtualization has come
7+
very far thanks to the cloud and WSL2 works pretty good now.
8+
Surely it must have become easy and reasonably performant to create a Linux VM on
9+
Windows and use that for development work. Let's even try to use Hyper-V since
10+
that is something the Microsoft Azure Platform is build on.
11+
12+
<!--more-->
13+
14+
## Creating a VM in Hyper-V
15+
16+
This step is actually pretty easy. [Microsoft has a very minimal and good documentation
17+
on how to do it](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/create-a-virtual-machine-in-hyper-v).
18+
You just need to follow the steps in the Hyper-V VM creation wizard.
19+
20+
After that is done, open the VM settings, search for "Integration Services" and
21+
then make sure to check the "Guest services" checkbox.
22+
23+
## Intializing the Linux VM
24+
25+
After you install the guest OS with the ISO, make sure to not forget to
26+
eject the ISO drive or else Hyper-V will load it again.
27+
28+
If you only want to run a Linux VM that has 0 contact with the host OS,
29+
then you done. You don't need to read further.
30+
However, usually you want to share files, devices and other resources with the host OS.
31+
And that is exactly why I made this blog post.
32+
It is not really straight forward to share these resources on a newly created VM.
33+
I am not sure why though since Hyper-V is a rather advanced Hypervisor.
34+
Well, it is Windows in the end so lets just dive into what we need,
35+
to make sure we have a somewhat pleasant desktop VM experience.
36+
37+
From what I could gather Hyper-V does not provide a native way to share the resources.
38+
Hyper-V has something called "enhanced session mode".
39+
This mode enables the VM to use / share some host OS resources like network connections,
40+
drives and audio devices. But where is the catch? Well, for all these features we
41+
are required to use the RDP protocol. Yes, you read it correctly.
42+
For some reason Microsoft did not think it would be good to provide these features
43+
out-of-the-box but rely on the RDP protocol. At least for me, that is a very weird decision.
44+
45+
This brings us to the next step. To be able to even activate the "enhanced session mode"
46+
for a VM, you need to install and configure a RDP server on your Linux VM.
47+
Otherwise it will simply not work.
48+
49+
### RDP and Xorg
50+
51+
This blog post is about setting up the [i3 window manager](https://i3wm.org/) in a VM on Windows.
52+
i3 is built on top of Xorg but Xorg itself does not implement the RDP protocol
53+
nor does it understand it. So we need to install something called [xrdp](https://www.xrdp.org/).
54+
You don't need to know much about it except it enables Xorg to understand the RDP protocol.
55+
Or to be more precise, xrdp acts as a frontend and Xorg will act as the backend.
56+
57+
### Actual setup
58+
59+
1. The first thing to do after the first boot is to install the following packages:
60+
61+
```bash
62+
sudo dnf install xrdp xrdp-selinux xorgxrdp hyperv-daemons
63+
```
64+
65+
This will install the required services needed to run a RDP server with Xorg as the backend.
66+
The `hyperv-daemons` package is something very essential here. It installs a couple
67+
of daemons that enable clipboard integration and other important features.
68+
69+
2. Before starting the xrdp server, you need to optimize some of its configuration.
70+
The following `sed` commands will handle the optimizations for you:
71+
72+
```bash
73+
sudo sed -i_orig 's/port=3389/port=vsock:\/\/-1:3389/g' /etc/xrdp/xrdp.ini
74+
sudo sed -i_orig 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
75+
sudo sed -i_orig 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
76+
sudo sed -i_orig 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
77+
```
78+
79+
3. One of they daemons installed by `hyperv-daemons` will automatically mount
80+
all drives that are shared with the VM into your home directory. The default name
81+
for the mount directory is not very *nice*. The next `sed` command renames it
82+
to `shared-drives`.
83+
84+
```bash
85+
sudo sed -i 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini
86+
```
87+
88+
4. Allow everyone to create X server sessions (required because of RDP):
89+
90+
```bash
91+
sudo tee /etc/X11/Xwrapper.config >/dev/null <<EOL
92+
needs_root_rights=no
93+
allowed_users=anybody
94+
EOL
95+
```
96+
97+
5. Make sure the Hyper-V specific kernel module is enabled:
98+
99+
```bash
100+
echo "hv_sock" | sudo tee /etc/modules-load.d/hv_sock.conf
101+
# Make sure VMware kernel module is blacklisted
102+
echo "blacklist vmw_vsock_vmci_transport" | sudo tee /etc/modprobe.d/blacklist-vmw_vsock_vmci_transport.conf
103+
```
104+
105+
6. Enable the xrdp service and shutdown the VM:
106+
107+
```bash
108+
sudo systemctl enable xrdp
109+
sudo systemctl enable xrdp-sesman
110+
poweroff
111+
```
112+
113+
7. Enable enhanced session mode for the VM (run this as Administrator in powershell):
114+
115+
```powershell
116+
Set-VM "VM NAME" -EnhancedSessionTransportType HVSocket
117+
```
118+
119+
Now you can start the VM again.
120+
A new dialog should now pop up asking you about resolution. Congrats! You are done!
121+
Now you should be able to run the VM in enhanced session mode and share OS resources
122+
with your VM.
123+
124+
There is one remaining issue which I could not solve yet.
125+
When using Xorg as the backend for xrdp, the screen is blurry and pixilated on heavy load.
126+
This is very weird especially because a friend of mine, who uses Arch Linux, can't reproduce this behaviour.
127+
I will update this blog once I find a solution to this issue or if I understand why this even happens.

0 commit comments

Comments
 (0)