Skip to main content

Cross-Platform Workflows

Integrating Windows with Linux environments - WSL, dual-boot, virtualization, and seamless file sharing workflows.

Windows Subsystem for Linux (WSL)

WSL Overview

WSL provides a Linux environment directly within Windows, offering the best of both worlds for developers and system administrators.

FeatureWSL 1WSL 2Native Linux
KernelTranslation layerReal Linux kernelNative kernel
PerformanceGoodExcellentExcellent
File systemWindows integrationVirtual diskNative
NetworkWindows network stackVirtualizedNative
Docker supportLimitedFullFull

Installing WSL

# Enable WSL feature
wsl --install

# Install specific distribution
wsl --install -d Ubuntu

# List available distributions
wsl --list --online

WSL Management Commands

TaskCommandPurpose
List distributionswsl --list --verboseShow installed distros
Set defaultwsl --set-default UbuntuSet primary distro
Start distrowsl -d UbuntuLaunch specific distro
Shutdownwsl --shutdownStop all WSL instances
Updatewsl --updateUpdate WSL kernel
Exportwsl --export Ubuntu backup.tarBackup distro
Importwsl --import NewUbuntu C:\WSL backup.tarRestore distro

File System Integration

Access PatternPathExample
Windows files from WSL/mnt/c/path/mnt/c/Users/john/Documents
WSL files from Windows\\wsl$\distro\path\\wsl$\Ubuntu\home\john
WSL home from Windows\\wsl$\Ubuntu\home\usernameDirect access to Linux home

WSL Networking

  • Localhost forwarding: Services in WSL accessible via localhost from Windows
  • Windows services: Accessible from WSL via Windows IP
  • Firewall: Windows Firewall affects WSL network access

WSL Best Practices

  1. Keep files in WSL: Better performance for Linux tools
  2. Use Windows files: For sharing with Windows applications
  3. Git repos in WSL: Better performance and permissions
  4. Development in WSL: Use WSL for development, Windows for GUI apps

Dual-Boot Configuration

Dual-Boot Options

Setup TypeProsConsBest For
Traditional dual-bootFull performanceReboot requiredDedicated use cases
WSLSeamless integrationSome limitationsDevelopment work
Virtual machineIsolated, safePerformance overheadTesting, learning

Dual-Boot Considerations

  1. Disk partitioning: Separate partitions for each OS
  2. Boot loader: GRUB or Windows Boot Manager
  3. Time sync: Handle timezone differences
  4. Shared data: FAT32 or NTFS partition for shared files

File System Compatibility

File SystemWindowsLinuxShared AccessNotes
NTFSNativeRead/write (ntfs-3g)YesWindows native
FAT32NativeNativeYes4GB file limit
ext4WSL/third-partyNativeLimitedLinux native
exFATNativeNativeYesGood for large files

Boot Manager Configuration

# Update GRUB (Linux)
sudo update-grub

# Add Windows entry to GRUB
sudo os-prober
sudo update-grub

Windows Boot Manager:

# List boot entries
bcdedit /enum

# Set default OS
bcdedit /default {identifier}

# Set timeout
bcdedit /timeout 30

Virtualization Solutions

Virtualization Options

SolutionTypePerformanceIntegrationBest For
VirtualBoxType 2 hypervisorGoodBasicLearning, testing
VMwareType 2 hypervisorExcellentAdvancedProfessional use
Hyper-VType 1 hypervisorExcellentWindows integrationWindows environments
DockerContainerizationExcellentDevelopment focusDevelopment, microservices

Hyper-V (Windows Pro/Enterprise)

# Enable Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

# Create new VM
New-VM -Name "Ubuntu" -MemoryStartupBytes 2GB -Generation 2

Docker on Windows

ScenarioSolutionNotes
WSL 2Docker Desktop with WSL 2Best performance
Windows containersDocker DesktopWindows-specific containers
Hyper-VDocker Desktop with Hyper-VLegacy option

File Sharing & Synchronization

Network File Sharing

ProtocolWindowsLinuxUse Case
SMB/CIFSNativeSambaWindows-centric networks
NFSClient supportNativeUnix-centric networks
SSH/SFTPThird-party toolsNativeSecure file transfer
FTPBuilt-in client/serverBuilt-in client/serverSimple file transfer

Setting Up Samba (Linux → Windows)

# Install Samba
sudo apt install samba

# Configure share
sudo nano /etc/samba/smb.conf

# Add share section
[shared]
path = /home/shared
browseable = yes
writable = yes
guest ok = yes

# Restart Samba
sudo systemctl restart smbd

Accessing from Windows

\\linux-ip-address\shared

Cloud Storage Integration

ServiceWindows ClientLinux ClientCommand Line
OneDriveNativeThird-partyrclone
Google DriveThird-partyThird-partyrclone
DropboxNativeNativedropbox-cli
NextcloudThird-partyNativenextcloudcmd

Synchronization Tools

ToolPlatformPurposeFeatures
rsyncLinux, WSLFile synchronizationIncremental, efficient
robocopyWindowsFile copyingMirror, resume
SyncToyWindowsFolder syncGUI, automated
UnisonCross-platformBidirectional syncConflict resolution

Development Workflows

Git Configuration

WSL/Linux:

# Configure Git
git config --global user.name "Your Name"
git config --global user.email "email@example.com"

# Use credential manager
git config --global credential.helper store

Windows:

# Use Windows Credential Manager
git config --global credential.helper manager-core

SSH Key Management

Generate SSH keys in WSL:

# Generate key
ssh-keygen -t ed25519 -C "your_email@example.com"

# Start SSH agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

Use SSH keys from Windows:

# Share SSH keys between Windows and WSL
ln -s /mnt/c/Users/username/.ssh ~/.ssh

IDE Integration

IDEWSL SupportRemote DevelopmentNotes
VS CodeExcellentWSL extensionSeamless integration
IntelliJGoodBuilt-in SSHRemote development
Visual StudioLimitedSSH supportWindows-focused
JetBrains IDEsGoodGateway toolRemote development

VS Code with WSL

# Install VS Code in WSL
code .

# Install VS Code extensions in WSL
code --install-extension ms-vscode-remote.remote-wsl

Container Workflows

Docker Integration

Docker Desktop with WSL 2:

  • Containers run in WSL 2 VM
  • Access from both Windows and WSL
  • Best performance for Linux containers

Container Development Patterns

PatternDescriptionBest For
WSL + DockerDevelopment in WSL, containers in DockerLinux-focused development
Windows + DockerDevelopment on Windows, Linux containersMixed environments
DevcontainersDevelopment inside containersConsistent environments

Example Workflow

# In WSL
git clone https://github.com/user/project.git
cd project

# Build and run container
docker build -t myapp .
docker run -p 8080:8080 myapp

# Access from Windows browser
# http://localhost:8080

Remote Access & Management

Remote Desktop (RDP)

Enable RDP on Windows:

Settings → System → Remote Desktop → Enable

Connect from Linux:

# Install RDP client
sudo apt install remmina

# Or use command line
rdesktop windows-ip-address

SSH on Windows

OpenSSH Server:

# Install OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

# Start and enable service
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'

Connect from Linux:

ssh username@windows-ip-address

Windows PowerShell Remoting

# Enable PS Remoting
Enable-PSRemoting -Force

# Connect from another Windows machine
Enter-PSSession -ComputerName target-computer

File Format Compatibility

Text Files & Line Endings

SystemLine EndingGit Config
WindowsCRLF (\r\n)core.autocrlf=true
LinuxLF (\n)core.autocrlf=input
macOSLF (\n)core.autocrlf=input

Handling Line Endings

# Convert Windows to Unix
dos2unix filename

# Convert Unix to Windows
unix2dos filename

# Git configuration for mixed environments
git config --global core.autocrlf input

Archive Formats

FormatWindowsLinuxBest For
ZIPNativeNativeGeneral use
7Z7-Zipp7zipHigh compression
TAR.GZWSL/toolsNativeLinux distributions
RARWinRARunrarLegacy archives

Network Configuration

Shared Network Resources

Windows Network Discovery:

Settings → Network & Internet → Advanced network settings → Network discovery

Linux Network Browsing:

# Browse Windows shares
smbclient -L //windows-ip-address

# Mount Windows share
sudo mount -t cifs //windows-ip/share /mnt/point -o username=user

VPN Configuration

VPN TypeWindowsLinuxNotes
OpenVPNClient appNative supportCross-platform
WireGuardClient appNative supportModern, fast
IKEv2NativestrongSwanEnterprise
PPTPNativeNativeLegacy, insecure

Backup & Migration Strategies

Backup Approaches

MethodWindows ToolsLinux ToolsScope
System imageWindows Backupdd, ClonezillaFull system
File backupFile Historyrsync, tarUser data
IncrementalWindows BackuprsnapshotChanged files only
Cloud backupOneDrivercloneOffsite storage

Migration Tools

ToolPurposePlatformNotes
Windows Easy TransferUser data migrationWindowsLegacy tool
User State Migration ToolEnterprise migrationWindowsEnterprise focused
rsyncFile synchronizationCross-platformEfficient transfers
clonezillaDisk imagingCross-platformComplete system clone

Cross-Platform Backup Script

#!/bin/bash
# Backup script that works in WSL and Linux

SOURCE="/mnt/c/Users/username/Documents"
DESTINATION="/backup/windows-docs"
DATE=$(date +%Y%m%d)

# Create timestamped backup
rsync -avh --delete "$SOURCE/" "$DESTINATION-$DATE/"

# Keep only last 7 backups
find /backup -name "windows-docs-*" -type d -mtime +7 -exec rm -rf {} \;

Performance Optimization

WSL Performance Tips

  1. Keep files in WSL filesystem: Avoid /mnt/c/ for development
  2. Use WSL 2: Better performance than WSL 1
  3. Limit memory usage: Configure .wslconfig file
  4. Disable Windows Defender: For WSL directories (if safe)

Network Performance

  • WSL networking: Use localhost for forwarded ports
  • File sharing: SMB3 protocol for better performance
  • VPN considerations: May affect WSL networking

Resource Management

# .wslconfig file in %USERPROFILE%
[wsl2]
memory=4GB
processors=2
swap=1GB
localhostForwarding=true

Security Considerations

Cross-Platform Security

  1. Firewall configuration: Windows Firewall affects WSL
  2. Antivirus exclusions: Exclude development directories
  3. SSH key security: Protect private keys across platforms
  4. File permissions: Different models between systems

Best Practices

  • Separate environments: Use VMs for untrusted code
  • Regular updates: Keep both systems updated
  • Backup verification: Test restore procedures
  • Access control: Use appropriate permissions
  • Network segmentation: Isolate development networks