Blog

Accidental Network Outage? Here’s How You Can Regain Access to Your Google Cloud Windows Instance

1 opcmxlrjkfmlcyltryxyg

You are performing some kind of configuration on a Google cloud-based Windows server and then it suddenly disconnects from the internet. I’m sure you have already encountered such issues before. This guide will show you how to recover quickly with minimal fuss.

This problem can arise due to errors in network, routing, and VPN client settings, not to mention Windows Firewall configuration issues.

While using Google Cloud (using the console), you can access the instance SAC (Special Administration console) interface via the serial console port. Through SAC, you can initiate and access the command-line interface with administrator privileges to resolve the problem.

The console is similar to a terminal window. The input and output are in text mode. There is also no graphical interface or mouse support.

Keep in mind that you will require the server or domain administrator password for the server to perform the following steps.

Let’s Simulate This Scenario

In order to create a demonstration for this article, I simulated a server that is disconnected from the Internet. I connected to the server and intentionally changed the instance IP address from Obtain an IP address automatically (DHCP) to a static setting with the IP 1.2.3.4.

1 zlvh0m4a rufj otjk55sq

As you can see, the server stopped responding to pings immediately. After a few seconds, the RDP (remote desktop) connection was also lost.

1 zed 0q8fcqoumkz68bda
1 5zafpmq8yhzqqkq51ptsjg

Getting the Server Back Online

1. On the Google Cloud Compute Engine page, click on the instance name, then click on Connect to serial console button:

1 n3irrcvyau2flnenr0h gw

If the button is greyed out and not clickable, click on Edit and check the Enable connecting to serial ports option. Save the changes.

If the instance is part of an instance group, or you prefer to work with cli, you can use the following gcloud command:

gcloud compute instances add-metadata <INSTANCE_NAME> --metadata serial-port-enable=1 --project <PROJECT-ID>
1 smsp4zmmsasmuixp6mb5hg

Click the Connect to serial console button. You should now see a new screen opening up with the instance console.

1 hezvicql8vj4jhkfunwqjq

2. The screen you see now is the output of the SAC, through which we will reach the command line interface.

SAC allows the execution of multiple operations, but I’ll keep things simple. Let’s use SAC to reach the server command-line interface.

1 hezvicql8vj4jhkfunwqjq (1)

3. Type in the command:

cmd

to create the command prompt session, and then type the command:

ch -sn <ChannelName>

to switch to the command line screen. Press Enter.

In the example below, the Channel name is Cmd0001.

1 ck1hz sryql7jcpqn9kg2w

Some connection details will now appear on the screen. This information is irrelevant to this demo. Press Enter in the console screen to proceed.

1 7oq13clzr245p0sgdsrtea

4. To access the command-line interface, you must connect with the domain/server administrator credentials. Enter the username, domain (optional), password, and press Enter.

1 tnt e5kcomlxuf2qpr88gw

You have now accessed the server’s command-line interface with administrator privileges:

1 vd5 g c4goy24uwbbvgnsq

5. Using cli commands, you can handle common configuration errors that may have caused the server to disconnect:

8. In the configuration error I simulated, I need to revert the network settings from a static IP setting of 1.2.3.4 to DHCP. Type:

ipconfig /all

to receive a list of the network interfaces configuration in the server.

1 tfjjnhaptw2m5hegip4kha

The server has one network interface named Ethernet, and the network interface IP address is 1.2.3.4.

9. Use the following command to change the interface settings from static IP to DHCP, replace InterfaceName with your server interface name:

netsh interface ip set address "<InterfaceName>" dhcp

1 uexi1npippxpett8nhvcsq

That’s it. The server is back online and responding to ping:

1 m3ihxch2ruxxt4eewrgbza

This methodology applies only to Google Cloud users who are dealing with accidental and sudden network disconnections. Stay productive!


Thanks for reading! To stay connected, follow us on the DoiT Engineering Blog, DoiT Linkedin Channel, and DoiT Twitter Channel. To explore career opportunities, visit https://careers.doit.com.

Subscribe to updates, news and more.

Related blogs