Visual Studio Code
Overview
Visual Studio Code (VS Code) is a free, open-source code editor developed by Microsoft. It combines a lightweight editor with IntelliSense code completion, integrated debugging, built-in Git support, syntax highlighting for hundreds of programming languages, and a large ecosystem of extensions from the Visual Studio Marketplace.
The SecureAnyCloud Visual Studio Code AMI delivers a preconfigured Windows Server instance on Amazon Web Services with VS Code installed and ready to use, so you can start coding as soon as you launch it. This guide covers launching the instance, connecting over RDP and working with the editor.
What you get:
- A cloud-based development environment you can reach from any device with an RDP client
- A consistent setup across team members, or centralized development workstations on AWS
- Scalable compute and low-latency connections to AWS services
- VS Code support for Python, JavaScript, TypeScript, C#, Java, Go, Rust, PHP and many more languages
If you run into any issue while following this guide, contact sales@secureanycloud.com.
Prerequisites
Before you launch the Visual Studio Code AMI, make sure you have the following in place.
- AWS account. You need an active AWS account with permissions to launch EC2 instances, manage security groups and access the AWS Marketplace.
- EC2 key pair. Create a key pair, or identify an existing one, in the region where you plan to launch the instance. You need this key pair to decrypt the Windows Administrator password after launch.
- Security group. Prepare a security group that allows inbound RDP: protocol TCP, port 3389, for Remote Desktop access.
- Remote Desktop client. Install an RDP client on your local machine. Options include Microsoft Remote Desktop (Windows and macOS), Remmina (Linux) or any other RDP-compatible client.
Restrict the source IP range for RDP access to your known IP addresses or corporate CIDR blocks. Do not allow access from 0.0.0.0/0.
Minimum instance requirements: 1 vCPU, 1 GB RAM and 30 GB of disk space.
The instance runs on these minimums, but a t3.small or t3.medium is recommended for a comfortable development experience. If you plan to run development servers or build tools, or work with large projects, choose a t3.medium or larger.
Step by Step Setup
Follow these steps to launch and connect to your Visual Studio Code instance.
Step 1 - Launch the instance
- Log in to your AWS account and open the AWS Marketplace.
- Search for the SecureAnyCloud Visual Studio Code AMI.
- Select your instance type. t3.small or larger is recommended.
- Choose your region and VPC configuration.
- Select the EC2 key pair you created in the prerequisites.
- Assign the security group with RDP access on port 3389.
- Configure storage with at least 30 GB on the root volume.
- Launch the instance.
Step 2 - Wait for the status checks
After you launch the instance, open the EC2 console and wait until the instance shows 2/2 status checks passing. This confirms that the instance has fully booted and Windows has completed its initial setup. It typically takes between 3 and 10 minutes.
Step 3 - Retrieve the Administrator password
- Open the EC2 console in the AWS region where you launched the instance.
- Select Instances in the left navigation panel.
- Select your newly launched instance.
- Click Actions at the top of the page.
- Go to Security, then select Get Windows password.
- Click Browse and upload the private key file (.pem) from the key pair you selected during launch.
- Click Decrypt password.
- Copy the decrypted password and store it securely. This is your Administrator password.
Step 4 - Connect with Remote Desktop
- Open your Remote Desktop client.
- Create a new connection to the public IP address of your EC2 instance. Use the private IP if you connect through a VPN or from within the same VPC.
- Enter the credentials when prompted. The username is Administrator, and the Password is the decrypted value from Step 3.
- If a certificate warning appears, click Continue. This is expected for new connections.
- You are now connected to the Windows Server desktop.
Step 5 - Launch Visual Studio Code
On the desktop, double-click the Visual Studio Code shortcut icon to launch the application. VS Code is preinstalled and ready to use immediately.
Server Components
The AMI is built on Windows Server and includes the base operating system with the latest Visual Studio Code, preinstalled and configured. VS Code includes its built-in terminal, Git integration and support for installing extensions for additional languages and tooling.
Filesystem Layout
The instance uses a single volume: drive C:\ holds the operating system and the application, with a minimum size of 30 GB.
Key directory locations on the instance:
- C:\Program Files\Microsoft VS Code\ is the VS Code installation directory.
- C:\Users\Administrator\Desktop\ is the desktop with the VS Code shortcut.
- C:\Users\Administrator.vscode\ is the extensions directory.
- C:\Users\Administrator\AppData\Roaming\Code\ holds user settings, keybindings and state.
- C:\Users\Administrator\Documents\ is the recommended location for project files.
If you work with large projects or many extensions, attach an additional EBS volume and use it as your project workspace. This keeps the system drive from filling up.
Managing the Application
Open a project folder
- Launch VS Code from the desktop shortcut.
- Click File, then Open Folder.
- Go to the folder that contains your project files and click Select Folder.
- VS Code opens the folder and shows the file tree in the Explorer panel on the left.
You can also open VS Code from the command line. Open Command Prompt and run:
code C:\path\to\your\projectInstall extensions
Extensions greatly expand what VS Code can do. To install one:
- Click the Extensions icon in the Activity Bar on the left side of the window, or press Ctrl+Shift+X.
- Search for the extension you want, for example Python, C#, ESLint or Prettier.
- Click Install on the extension.
- Reload VS Code if the extension asks for it.
Popular extensions for common development workflows include:
- Python by Microsoft for Python development with IntelliSense and debugging
- C# by Microsoft for .NET development
- ESLint for JavaScript and TypeScript linting
- Prettier for code formatting
- GitLens for enhanced Git capabilities
- Remote SSH for connecting to remote servers
- Docker for container management
- AWS Toolkit for interacting with AWS services
Use the integrated terminal
VS Code includes a built-in terminal, so you can run commands without leaving the editor:
- Press Ctrl+` (backtick), or go to Terminal, then New Terminal.
- The terminal opens at the bottom of the VS Code window.
- Run commands, scripts and build tools directly from it.
- Click the + button in the terminal panel to open additional terminals.
Use Git integration
VS Code has built-in Git support:
- Open a project folder that is a Git repository, or initialize one with
git init. - Click the Source Control icon in the Activity Bar, or press Ctrl+Shift+G.
- View changed files, stage changes, write commit messages and commit directly from the VS Code interface.
- Push, pull and sync with remote repositories from the Source Control panel.
If Git is not installed on the instance, download it from the official Git website using the built-in browser and install it.
Configure settings
You can customize VS Code settings to match your preferences:
- Press Ctrl+,, or go to File, then Preferences, then Settings.
- Search for settings by name or browse the categories.
- Changes are saved automatically and apply immediately.
- For advanced configuration, click the Open Settings (JSON) icon in the top right to edit the settings file directly.
Use IntelliSense
IntelliSense provides intelligent code completion, parameter info, quick info and member lists:
- Start typing in the editor, and IntelliSense suggestions appear automatically.
- Press Ctrl+Space to trigger IntelliSense manually.
- Use the arrow keys to move through suggestions, and press Tab or Enter to accept one.
- Install language-specific extensions for better IntelliSense support.
Debug your code
VS Code includes a powerful debugger:
- Open the file you want to debug.
- Set breakpoints by clicking in the gutter next to the line numbers.
- Click the Run and Debug icon in the Activity Bar, or press Ctrl+Shift+D.
- Configure a launch configuration if prompted. VS Code provides templates for common scenarios.
- Click the green play button to start debugging.
- Use the debug toolbar to step through code, inspect variables and evaluate expressions.
Use the Command Palette
The Command Palette gives you access to all VS Code commands:
- Press Ctrl+Shift+P to open the Command Palette.
- Type the name of the command you want to run.
- Select the command from the list and press Enter.
Scripts and Logs
VS Code logs
VS Code writes log files that help you diagnose application issues.
- C:\Users\Administrator\AppData\Roaming\Code\logs\ holds the VS Code application logs.
- C:\Users\Administrator.vscode\extensions\ is the installed extensions directory.
To view the logs from within the application, open the Command Palette (Ctrl+Shift+P) and type Developer: Open Logs Folder. This takes you directly to the log directory.
Extension output
Many extensions write output to the Output panel:
- Go to View, then Output, or press Ctrl+Shift+U.
- Select the extension or channel from the dropdown to view its output.
Windows event logs
For system-level diagnostics, use the Windows Event Viewer. Press the Windows key, search for Event Viewer and open it to review application and system logs.
Troubleshooting
Cannot connect over RDP
- Verify that the instance has passed 2/2 status checks in the EC2 console.
- Confirm that your security group allows inbound TCP traffic on port 3389 from your IP address.
- Confirm that you are using the correct public IP address. If the instance was stopped and started, the public IP may have changed unless you use an Elastic IP.
- Check that your local firewall or corporate network is not blocking outbound RDP connections.
Password decryption fails
- Make sure you upload the .pem file that matches the key pair selected during instance launch.
- The password can take up to 15 minutes to become available after the first launch. If the option is greyed out, wait and try again.
VS Code does not launch or crashes
- Launch VS Code again from the desktop shortcut, or run
codefrom Command Prompt. - If the state is corrupted, delete the VS Code state directory at C:\Users\Administrator\AppData\Roaming\Code\ and restart the application.
- Check the Windows Event Viewer for application error messages.
- Verify that the C: drive has enough free space.
Extensions fail to install
- Make sure the instance has outbound internet access on port 443 (HTTPS), so VS Code can reach the Visual Studio Marketplace.
- If the instance is in a private subnet, configure a NAT gateway to allow outbound traffic.
- Install the extension from the command line with
code --install-extension <extension_id>.
IntelliSense is not working
- Make sure the right language extension is installed, for example the Python extension for .py files.
- Some languages need an additional runtime. For example, Python IntelliSense requires Python to be installed on the system.
- Reload VS Code: press Ctrl+Shift+P and type Developer: Reload Window.
The integrated terminal does not open
- Open a new terminal from the menu bar: Terminal, then New Terminal.
- If PowerShell is not available, switch the default shell to Command Prompt. In the VS Code settings, search for terminal.integrated.defaultProfile.windows.
VS Code performance is poor
- Upgrade to a larger instance type with more CPU and RAM.
- Disable extensions you are not using, to reduce resource consumption.
- Close files and editor tabs you do not need.
- Reduce the number of open terminals.
Insufficient disk space
- Extensions and their dependencies can use a lot of disk space. Remove unused extensions from the Extensions panel.
- Monitor the C: drive usage in Windows Explorer.
- Attach an additional EBS volume for project files.
The RDP session disconnects frequently
- Check that your network connection is stable.
- Lower the display quality or disable visual effects in the RDP client settings to reduce bandwidth requirements.
- Make sure the instance is not running out of memory, which can make Windows unresponsive.
Security Recommendations
Change the Administrator password
After your first login, change the default Administrator password to a strong, unique password. Open Command Prompt or PowerShell and run:
net user Administrator YourNewStrongPasswordOnce you change the password, the original decrypted password from the AWS console is no longer valid.
Restrict RDP access
Limit the security group rule for port 3389 to your own IP addresses or a trusted CIDR range. Do not use 0.0.0.0/0, because it exposes the instance to RDP brute-force attacks from the entire internet.
Install only trusted extensions
Install extensions only from verified publishers on the Visual Studio Marketplace. Extensions can access files on the system and execute code, so make sure you trust the source before you install one.
Use IAM roles for AWS development
If you use the AWS Toolkit extension or develop applications that interact with AWS services, attach an IAM role to the EC2 instance instead of storing AWS access keys on the server. This gives you automatic credential rotation and removes the risk of leaked keys.
Configure Windows Firewall rules
Review the Windows Firewall and restrict inbound and outbound traffic to what your development workflow needs.
Keep software updated
Update VS Code and Windows Server regularly to get the latest security patches and bug fixes. VS Code checks for updates automatically and notifies you when a new version is available.
Secure your source code
If you work with proprietary source code on this instance, put appropriate access controls in place. Use private Git repositories and authenticate with SSH keys or personal access tokens.
Use an Elastic IP
Assign an Elastic IP to your instance to keep the same IP address across stop and start cycles. A stable address keeps your firewall rules consistent and simplifies access management.
Enable CloudWatch monitoring
Configure Amazon CloudWatch to monitor instance metrics such as CPU utilization, memory usage and disk space. Set up alarms that notify you when resources run low.
Back up your work
Commit and push your code to a remote repository regularly with Git. Also use EBS snapshots to take periodic backups of the instance volume. Together they protect you against accidental data loss.
Support
If you run into an issue this guide does not cover, the SecureAnyCloud support team is available to help.
- Email: sales@secureanycloud.com
- Phone: (+44) 02045382725
- Website: secureanycloud.com
- Address: 3rd Floor, 86 90 Paul Street, London, EC2A 4NE
Support covers any issue related to the AMI, including connectivity problems, software configuration and general guidance on using the preconfigured environment.
When you contact support, include your EC2 instance ID, the AWS region, a description of the issue and any relevant error messages or screenshots.
Deploy on AWS
Launch Visual Studio Code with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com