Optimizing rdesktop for Windows 7 VM: Best Performance Settings on Linux LAN


2 views

For optimal rdesktop performance with a Windows 7 VM on LAN, use these command-line parameters:

rdesktop -a 32 -z -x lan -u username -p password -g 90% vm-ip-address

Key switches explained:

  • -a 32: 32-bit color depth (matches Windows 7 default)
  • -z: Enables compression
  • -x lan: Optimizes for LAN connections
  • -g 90%: Window size at 90% of your screen

On your Windows 7 VM, make these adjustments:

1. Open gpedit.msc
2. Navigate to:
   Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Remote Session Environment
3. Enable:
   - "Use the hardware graphics adapter for all Remote Desktop Services sessions"
   - "Configure compression for RemoteFX data"
4. Set "RemoteFX for Windows Server 2008 R2" to Enabled

For full multimedia support:

rdesktop -r sound:local -r clipboard:PRIMARYCLIPBOARD vm-ip-address

This enables:

  • Local sound redirection (-r sound:local)
  • Bidirectional clipboard sync (-r clipboard:PRIMARYCLIPBOARD)

Create a bash script for automatic reconnection:

#!/bin/bash
while true; do
  rdesktop -a 32 -z -x lan -u myuser -p mypass -g 90% -r disk:share=/path/to/share 192.168.1.100
  sleep 5
done

Save as rdp_autoconnect.sh and make executable with chmod +x rdp_autoconnect.sh

If experiencing lag, try adding these parameters:

rdesktop -5 -P -C -D -K vm-ip-address

Where:

  • -5: Use RDP5 protocol
  • -P: Enable persistent bitmap caching
  • -C: Use private color map
  • -D: Hide window manager decorations
  • -K: Keep window manager key bindings

To minimize latency on LAN connections, use these rdesktop flags:

rdesktop -z -P -x l -r clipboard:PRIMARYCLIPBOARD -D -K 192.168.1.100

Key parameters:

  • -z: Enables RDP compression
  • -x l: LAN optimization (use -x m for broadband or -x h for modem)
  • -P: Enables bitmap caching
  • -r clipboard:PRIMARYCLIPBOARD: Bidirectional clipboard

For multi-monitor setups or resolution control:

rdesktop -f -a 32 -r disk:share=/path/to/share 192.168.1.100

Options breakdown:

  • -f: Fullscreen mode (Ctrl+Alt+Enter to toggle)
  • -a 32: 32-bit color depth
  • -r disk:share: Folder redirection

On your Windows 7 VM, enable these settings:

  1. Open gpedit.msc and navigate to:
    Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services
  2. Enable "Limit maximum color depth" and set to 32-bit
  3. Disable "Turn off wallpaper" and "Turn off font smoothing"
  4. Set "Remote Desktop Session Host" -> "Connections" -> "Limit number of connections" to 1

For multimedia and device support:

rdesktop -r sound:local -r comport:COM1=/dev/ttyS0 -r printer:"My Printer"=/dev/usb/lp0 192.168.1.100

For enterprise environments, add NLA and certificate validation:

rdesktop -u administrator -p - -d domain -N -T "Production VM" 192.168.1.100

Create a bash wrapper for quick connections:

#!/bin/bash
SERVER_IP="192.168.1.100"
RESOLUTION="$(xrandr | grep '*' | awk '{print $1}')"
rdesktop -g $RESOLUTION -z -P -x l -a 32 -r clipboard:PRIMARYCLIPBOARD -D -K $SERVER_IP

Save as rdp_connect.sh and make executable with chmod +x rdp_connect.sh.