I was helping a client roll out AWS WorkSpaces for their remote engineering team when half the fleet showed up as Unhealthy in the console. Users were getting connection timeouts, and the ones who could connect were being kicked out every few minutes. It was a mess, and the root cause wasn’t obvious at all.
If you’ve ever stared at a WorkSpaces directory wondering why nothing is registering properly, this post is for you.
The Problem
Users attempting to launch their WorkSpaces client see one of these errors:
| Error | What It Means |
|---|---|
An error occurred while trying to connect to your WorkSpace |
Client cannot reach the WorkSpaces streaming gateway |
Your WorkSpace is currently unhealthy |
The WorkSpace instance failed health checks |
WorkSpace registration failed |
The WorkSpace could not join the directory |
Unable to connect. Check your network connection |
Outbound ports are blocked |
The WorkSpaces console shows instances cycling between Available and Unhealthy, or stuck in Stopped with no way to start them.
Why Does This Happen?
- Security group rules blocking required ports: WorkSpaces needs outbound access on ports 443 (HTTPS), 4172 (PCoIP/WSP streaming), and 4195 (session management). Many corporate VPC setups block these by default.
- DNS resolution failures: WorkSpaces relies on the directory’s DNS servers to resolve internal hostnames. If the DHCP options set in the VPC points to the wrong DNS, registration fails silently.
- Directory trust or domain join issues: If you’re using AD Connector or AWS Managed Microsoft AD with a trust, the WorkSpace machine account can’t join the domain when firewall rules between VPCs or on-premises AD are misconfigured.
- Subnet routing problems: WorkSpaces must be launched in private subnets with NAT gateway access. Placing them in a public subnet or a subnet without a route to the internet causes streaming failures.
- Health check timeouts from resource exhaustion: Underpowered bundles (especially Value tier) can fail health checks under load, making WorkSpaces appear unhealthy when the instance is simply overloaded.
The Fix
Step 1: Verify the Directory Health
Start by checking whether the directory itself is healthy.
aws workspaces describe-workspace-directories \
--query "Directories[*].{DirectoryId:DirectoryId,State:State,DirectoryType:DirectoryType}" \
--output table
If the state is anything other than Registered, the directory needs to be re-registered or the underlying AD Connector / Managed AD has a problem.
Step 2: Check the WorkSpaces Health Status
aws workspaces describe-workspaces \
--query "Workspaces[?State!='AVAILABLE'].{WorkspaceId:WorkspaceId,State:State,UserName:UserName,BundleId:BundleId}" \
--output table
Look for WorkSpaces stuck in UNHEALTHY, STOPPED, or ERROR states. Note the WorkspaceId values for the next steps.
Step 3: Validate Security Group Rules
WorkSpaces require specific outbound rules. Check the security groups attached to your WorkSpaces directory.
aws workspaces describe-workspace-directories \
--query "Directories[0].WorkspaceSecurityGroupId" \
--output text
Then verify the outbound rules on that security group:
aws ec2 describe-security-groups \
--group-ids sg-0abc123def456 \
--query "SecurityGroups[0].IpPermissionsEgress" \
--output json
You need at minimum:
| Port | Protocol | Destination | Purpose |
|---|---|---|---|
| 443 | TCP | 0.0.0.0/0 | HTTPS API calls and auth |
| 4172 | TCP/UDP | 0.0.0.0/0 | PCoIP or WSP streaming |
| 4195 | TCP | 0.0.0.0/0 | Session management |
| 53 | TCP/UDP | Directory DNS IPs | DNS resolution |
If any of these are missing, add them:
aws ec2 authorize-security-group-egress \
--group-id sg-0abc123def456 \
--protocol tcp \
--port 4172 \
--cidr 0.0.0.0/0
Step 4: Verify DNS and DHCP Options
WorkSpaces depend on the VPC’s DHCP options set for DNS. If this points to the wrong servers, directory joins fail.
aws ec2 describe-vpcs \
--vpc-ids vpc-0abc123 \
--query "Vpcs[0].DhcpOptionsId" \
--output text
aws ec2 describe-dhcp-options \
--dhcp-options-ids dopt-0abc123 \
--query "DhcpOptions[0].DhcpConfigurations" \
--output json
The domain-name-servers value must point to your Active Directory DNS servers, not to AmazonProvidedDNS, unless you’re using AWS Managed Microsoft AD with default DNS forwarding.
Step 5: Test Subnet Routing
Confirm the subnets used by WorkSpaces have a route to a NAT gateway:
aws ec2 describe-route-tables \
--filters "Name=association.subnet-id,Values=subnet-0abc123" \
--query "RouteTables[0].Routes[?DestinationCidrBlock=='0.0.0.0/0']" \
--output table
You should see a route pointing to a NAT gateway (nat-xxxx). If the route points to an internet gateway (igw-xxxx), your WorkSpaces are in a public subnet, which is not supported.
Step 6: Reboot Unhealthy WorkSpaces and Verify
Once networking is fixed, reboot the affected WorkSpaces:
aws workspaces reboot-workspaces \
--reboot-workspace-requests WorkspaceId=ws-abc123def
Wait a few minutes, then verify the health status:
aws workspaces describe-workspaces \
--workspace-ids ws-abc123def \
--query "Workspaces[0].{State:State,ComputerName:ComputerName}" \
--output table
The state should return to AVAILABLE.
Is This Safe?
Yes. All diagnostic commands are read-only. The security group changes are additive (adding outbound rules, not removing inbound protections). Rebooting a WorkSpace is equivalent to restarting a user’s desktop and does not destroy data.
Key Takeaway
Most AWS WorkSpaces failures come down to networking — blocked ports, wrong DNS, or missing NAT routes. The WorkSpaces console doesn’t give you great error messages, so you have to work backwards from the health status to the underlying VPC configuration. Always validate your security groups and DHCP options set before blaming the WorkSpaces service itself.
Have questions or ran into a different WorkSpaces issue? Connect with me on LinkedIn or X.