How to Transfer Files via RDP from Ubuntu to Windows Server 2012 Using rdesktop Disk Redirection


17 views

When using rdesktop from Linux to Windows Server 2012, file transfer isn't as straightforward as drag-and-drop between local machines. The -r disk: parameter enables disk redirection, but accessing the shared directory requires specific steps.

The correct command structure should be:

rdesktop -u administrator -p your_password -r disk:linux_share=/path/to/local/folder server_ip_address

Key parameters explained:

  • linux_share: The label that will appear in Windows Explorer
  • /path/to/local/folder: Absolute path to your Ubuntu directory
  • Server IP must be accessible from your Ubuntu machine

After establishing the RDP connection:

  1. Open Windows Explorer
  2. Navigate to "This PC"
  3. Look for a new device labeled with your share name (e.g., linux_share)

If the share doesn't appear, check these troubleshooting steps:

# Verify the share is properly mapped in your RDP session
net use

# Alternative connection method with debug output
rdesktop -u user -p pass -r disk:debug_share=/home/user/docs -d domain 192.168.1.100 > rdp_log.txt 2>&1

If disk redirection proves problematic, consider these alternatives:

SCP Transfer

# From Ubuntu to Windows (requires OpenSSH server on Windows)
scp /local/file.txt administrator@windows_server:C:\\Users\\administrator\\Desktop\\

Samba Share

# Mount Windows share on Ubuntu first
sudo mount -t cifs //windows_server/share_name /mnt/win_share -o username=user,password=pass

Windows Server 2012 may block access due to:

  • Local policy restrictions on device redirection
  • User Account Control (UAC) limitations
  • Network Level Authentication requirements

To enable proper access:

# On Windows Server, run in PowerShell as Admin:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" -Name "fDisableCdm" -Value 0
Restart-Service TermService -Force

For better performance with large files:

rdesktop -u user -p pass -r disk:fast_transfer=/big_folder -5 -P -z -x m server_ip

Where:

  • -5: Enable RDP 5.1+ features
  • -P: Enable bitmap caching
  • -z: Enable compression
  • -x m: Medium-quality graphics

When working with rdesktop to connect from Ubuntu to Windows Server 2012, the -r disk: parameter enables folder sharing through disk redirection. This creates a virtual disk mapping between the client (Ubuntu) and server (Windows) machines.

The proper syntax for mapping a local Ubuntu directory to the Windows server is:

rdesktop -u username -p password -r disk:sharename=/local/path server_IP

For example, to share your home directory:

rdesktop -u administrator -p mypassword -r disk:ubuntu_home=/home/myuser 192.168.1.100

After establishing the connection:

  1. Open Windows Explorer on the server
  2. Navigate to "This PC" (or "My Computer" in older versions)
  3. Look for a new drive labeled with your share name (e.g., "ubuntu_home")

If the shared folder doesn't appear:

  • Verify the Windows Server has drive redirection enabled in Group Policy (gpedit.msc > Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Device and Resource Redirection)
  • Ensure your Windows user account has sufficient permissions
  • Try restarting the Remote Desktop Services

If disk redirection proves problematic:

# Using scp if SSH is enabled
scp /local/file.txt username@server_IP:C:/destination/

# Mounting Windows share on Ubuntu
sudo mount -t cifs //server_IP/sharename /mnt/winshare -o username=user,password=pass

When using rdesktop:

  • Consider using -g to specify a smaller window size for better performance
  • Use -P for persistent bitmap caching to improve speed
  • For production environments, implement SSL/TLS encryption with -a 16 for 16-bit color