accidentally disabled network adapter on virtual machine

2,164 views
Skip to first unread message

Tu Tu

unread,
Jan 3, 2019, 11:40:29 AM1/3/19
to gce-discussion

I accidentally disabled the network adapter on Windows virtual machine on compute engine. I tried delete-access-config and add-access-config through gcloud utility and that did not seem to make any difference. Any suggestions on how to enable the network adapter back so I can RDP back into VM or am I going to have to re-build the VM?

Yui (Google Cloud Support)

unread,
Jan 3, 2019, 3:26:39 PM1/3/19
to gce-discussion
RDP is out of the question since network adapter is shutdown. Now in order to go inside your server please, follow these steps:

Connect to serial console on Serial port 2 (use the drop down box) - [Compute engine>Vm instances>connect to serial console] It is possible you might need to stop your instance and activate that feature before being able to use it.

a-A new window will open type : cmd (this creates a Windows command prompt channel) 
b-Type: ch -sn cmd0001 (this switches to channel 1) - please connect to channel that was just created. You will see that a channel got created. If channel 2 gets created use 
 ch -sn cmd0002 instead.
c-Press any key to confirm connection to the channel 
d-Enter username and password. Leave domain blank if no domain is configured. 


Once inside Windows, run the following to get name of adapter and enable it.

netsh interface show interface
-netsh interface set interface "YOUR-ADAPTER-NAME" enable

Tu Tu

unread,
Jan 3, 2019, 8:33:33 PM1/3/19
to gce-discussion
Hello , Thanks you for your quick respond . I have search on google and get message like you . I stuck at A step . The new window open but I can't type or do anything .

Screenshot 2019-01-04 08.20.02.png

Larbi (Google Cloud Support)

unread,
Jan 4, 2019, 2:14:02 PM1/4/19
to gce-discussion
Hi,

First, you need to enable the serial port on the cloud shell using the gcloud command or trough the console [1].

gloud command line:

   gcloud compute project-info add-metadata --metadata serial-port-enable=1

The console:
  1. Go to the Metadata page.
  2. Click Edit to edit metadata entries.
  3. Add a new entry with the key serial-port-enable and value 1.

Then, to connect the serial port on Windows VM you can use the gcloud command below (replace with your windows instance name) or trough the console [2]

gloud command line:

   gcloud compute connect-to-serial-port <windows instance name> --port 2

The console:

  1. Click the instance you want to connect to.
  2. Under Remote access, click Connect to serial console to connect on the default port (port 1).
  3. If you want to connect to another serial port, click the down arrow next to the Connect to serial console button and change the port number accordingly.
  4. For Windows instances, pull down the dropdown menu next to the button and connect to Port 2 to access the serial console.

Links:
[1]https://cloud.google.com/compute/docs/instances/interacting-with-serial-console
[2]https://cloud.google.com/compute/docs/instances/interacting-with-serial-console#connectserialconsole

Tu Tu

unread,
Jan 4, 2019, 10:56:30 PM1/4/19
to gce-discussion
Hello , I read
[1]https://cloud.google.com/compute/docs/instances/interacting-with-serial-console

Carefully and I already do it , but after I click to connect to serial consolo port 2 . It open new windows same the picture I already upload before . I already try use gcloud to connect and I still can't enter anything

This is picture in my cloud

Screenshot 2019-01-05 10.52.08.png

Screenshot 2019-01-05 10.52.13.png

Screenshot 2019-01-05 10.52.19.png

  1. 1
  2. 2
  3. 3

Veera (Google Cloud Support)

unread,
Jan 6, 2019, 6:41:58 PM1/6/19
to gce-discussion

Hello,


I was unable to reproduce the issue. I suggest following the below method to resolve this issue, try enabling the network adapter by using a temporary startup script [1] by following these steps:


1. Go to Google Cloud Console -> select your Compute Engine instance -> Click Edit.

2. Under custom metadata, type ‘windows-startup-script-cmd’[2] on key box and type ‘netsh interface set interface name="Local Area Connection" admin=enabled’ [2] on value.

3. Click ‘save’.

4. Restart your instance by clicking on ‘Reset’.

5. After rebooting try connecting to your instance through RDP.


[1] https://cloud.google.com/compute/docs/startupscript#providing_startup_script_contents_directly

[2] https://cloud.google.com/compute/docs/startupscript#providing_a_startup_script_for_windows_instances


Tu Tu

unread,
Jan 6, 2019, 8:13:47 PM1/6/19
to gce-discussion
Hello , I already try
netsh interface set interface name="Local Area Connection" admin=enabled
netsh interface set interface name="Ethernet" admin=enabled
netsh interface set interface name="Ethernet" enabled

3 option but it still can't connect :(((( . What should I do ?

Mehdi (Cloud Platform Support)

unread,
Jan 8, 2019, 11:55:21 PM1/8/19
to gce-discussion
Hello,

Please try the exact syntax and command provided in this similar story.
Reply all
Reply to author
Forward
0 new messages