DEV Community

Sam Erickson
Sam Erickson

Posted on

Improving Performance With Linux Boxes in Hyper-V

This post contains a collection of StackOverflow posts that were used to solve my Linux box performance issues in Hyper-V. All original pages are listed, where the commands from those sources are written out along with the story of how I used them.

πŸ“ˆ Improving Performance

I found the UI to be really clunky and slow on HiDPI monitors, and after some digging I found the following things to improve performance:

πŸ’« Disable Compositing

Source: xrdp is quite slow

This setting can be tested using:

xfconf-query --channel=xfwm4 --property=/general/use_compositing --type=bool --set=false --create
Enter fullscreen mode Exit fullscreen mode

After entering the above command I found that my performance issues were far less noticeable. So the next thing I needed to do was make the fix permanent, so I added the following to a new file /etc/X11/xorg.conf (I found the location to add this configuration file by reading through man xorg.conf):

Section "Extensions"
    Option "Composite" "Disable"
EndSection 
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ This can also be edited using the GUI: xfwm4-tweaks-settings

I then rebooted and checked the GUI to see if my edits to the xorg.conf configuration file worked.

❎ Optimize XRDP Configuration

Source: xrdp and xfce4 Ubuntu > 18.04 Unusable

The settings that I modified in the /etc/xrdp/xrdp.ini file were:

max_bpp = 128
xserverbpp = 128
crypt_level = low
Enter fullscreen mode Exit fullscreen mode

The final recommendation was to lower the color quality from 32 bits to 16 bits. I was unable to modify this setting by using the β€œConnect” button within Hyper-V Manager, so the next thing I needed to do was configure xrdp to allow connections outside the console

πŸ–₯️ Allowing RDP Connections Outside Hyper-V

Sources:

Edit the following file /etc/X11/Xwrapper.config:

# Change this value
allowed_users=console

# To this value
allowed_users=anybody
Enter fullscreen mode Exit fullscreen mode

Next we need to configure xrdp to listen for outside connections through tcp by adding the following to /etc/xrdp/xrdp.ini:

port=vsock://-1:3389 tcp://:3389
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ Note that you will need to restart xrpd for this change to take effect. Make sure you take note of your ip address before restarting xrdp so that you can connect using the RDP app, and not have to go back in through Hyper-V once your session is closed.

It is also worth noting that entering service xrdp restart will boot your RDP client, but keep you logged in. Which will result in you not being able to connect another RDP session until you restart your box.

Top comments (1)

Collapse
 
samerickson profile image
Sam Erickson

Note that you may also need to run the following: sudo adduser xrdp ssl-cert