DEV Community

Sam Erickson
Sam Erickson

Posted on

10

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.

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (1)

Collapse
 
samerickson profile image
Sam Erickson β€’

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

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay