Using Google Virtual NIC Stay organized with collections Save and categorize content based on your preferences.
Google Virtual NIC (gVNIC) is a virtual network interface designed specificallyfor Compute Engine. gVNIC is an alternative to thevirtIO-based ethernet driver.
As the next generation network interface which succeeds VirtIO, gVNIC replacesVirtIO-Net as the only supported network interface in Compute Enginefor all newmachine types(Generation 3 and onwards). Newer machine series andnetworking features require gVNIC instead of VirtIO. Consuming gVNICas the modern I/O interface with Compute Engine VMs offers the followingadvantages:
- Provides better performance.
- Improves consistency by reducing noisy neighbor problems.
- Introduces new network capabilities beyond what VirtIO is capable of.
Before you begin
- If you use gVNIC with Windows Server or Windows client images, make sure thegVNIC driver uses GooGet package version
1.0.0@45or later. - If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- Set a default region and zone.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
When to use gVNIC
gVNIC is supported and recommended for all machine families and generations.Some generations support only gVNIC. Others require gVNIC use underspecial conditions. To identify the generation for your machine series, seeCompute Engine terminology.
gVNIC use by machine series generation is as follows:
- Third generation and later machine series, excluding bare metal instances,support only gVNIC for the virtual network interface.
First or second generation machine series must use gVNIC for the virtualnetwork interface for instances if they meet any of the following conditions:
- The instance runs on theArm CPU platform.
- The instance is aConfidential VM instance.
The instance needs to achieve network speeds between 50 and100 Gbps. This applies to instances that meet the followingcriteria:
- Instances that supportper VM Tier_1 networking performance
- A2, G2, and N1 instances that support thesehigher network bandwidths
Pricing
To see the latest prices for Tier_1 networking, refer to theVM instances pricing page.
For a list of additional methods that can be used to find pricing information,seeCompute Engine pricing.
Operating system support
On Compute Engine, you can choose to use gVNIC on anysupported public operating system (OS) images. You canmanually install the gVNIC driver in these cases:
- The OS image doesn't include the gVNIC driver
- The OS image doesn't have the latest gVNIC driver version
For the supported operating systems, see theInterfaces tab foranoperating system.Also check theNetworking features tab for networking feature support.
Use on non-supported operating systems
For OS images that support gVNIC but don't include the latest version of thegVNIC driver, you can download the latest driver version from GitHub.
You can manually configure and install the latest version of the gVNIC driveron either Linux or Windows VMs.
After you update the operating system in your VM to use gVNIC,create a custom OS image based on that OSimage. You can then use the custom OS image to create additional VMs that usegVNIC on that operating system. For more information about creating VMs usinga custom OS image, seeCreate a custom OS image that supports gVNIC on thispage.
Use the following procedures to manually configure and install the latestversion of the gVNIC driver.
Caution: Before conducting a manual installation of the gVNIC driver, consultwith your operating system distributor's out-of-tree (oot) support policy andtainted kernel support policy.- For Linux VMs, seeLinux kernel driver Compute Engine Virtual Ethernet.
- For VMs running on FreeBSD, seeCompute Engine Virtual Ethernet FreeBSD driver.
- For Windows VMs, seeWindows driver for Compute Engine Virtual Ethernet.
Overview of using gVNIC with Compute Engine VMs
To create a VM that uses gVNIC, complete the following steps:
- Choose apublic OS image thatsupports gVNIC, or create a custom OS image that is tagged to use gVNIC.
- Create a VM using the public or custom OS image. During the VM creation,configure the network interface to use gVNIC.
- Verify that gVNIC is enabled.
If you encounter any issues, seeTroubleshooting Google Virtual NIC.
Create a custom OS image that supports gVNIC
You can create the OS image using either theGoogle Cloud CLI orREST. For detailedinformation and best practices for creating custom OS images, seeCreate custom OS images.
gcloud
Select an OS image or image family that supports gVNIC.For more information, seeOperating system details.
Using the OS image or image family selected in the previous step, createa custom OS image and tag this OS image with
GVNIC. To create thecustom OS image, use thegcloud compute images createcommand.For example, the following command creates a custom OS image thatsupports gVNIC and that's based on a specific OS image.gcloud compute images createIMAGE_NAME \ --source-image=SOURCE_IMAGE \ --source-image-project=SOURCE_IMAGE_PROJECT \ --guest-os-features=GVNIC
Replace the following:
IMAGE_NAME: the name of the image that youwant to createSOURCE_IMAGE: a specific OS image thatsupports gVNIC—for example:rocky-linux-8-optimized-gcp-v20220719If you want to use the latest OS image in animage family, replace the
--source-imageflag with the--source-image-familyflag and setits value to an image family that supports gVNIC. For example:--source-image-family=rocky-linux-8-optimized-gcp.SOURCE_IMAGE_PROJECT: the name of the projectthat contains the source OS image or image family
Example
To create a Rocky Linux 8 Optimized for Google Cloud OS image using thelatest OS image from the Compute Engine
rocky-linux-8-optimized-gcpimage family, run the following command:gcloud compute images createIMAGE_NAME \ --source-image-family=rocky-linux-8-optimized-gcp \ --source-image-project=rocky-linux-cloud \ --guest-os-features=GVNIC
For more information about when to use image families, seeImage family best practices.
REST
Select an OS image or image family that supports gVNICFor more information, seeOperating system details.
Using the OS image or image family selected in the previous step, createan OS image and tag this OS image with
GVNIC. To create the OS image,use theimages.insertmethod.POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/images{ "name":"IMAGE_NAME", "sourceImage":"SOURCE_IMAGE_URI", "guestOsFeatures":[ { "type":"GVNIC" } ]}Replace the following:
PROJECT_ID: the ID of the project in which to create the new imageIMAGE_NAME: a name for the custom imageSOURCE_IMAGE_URI: the URI for the specificOS image or image family that you want to useFor example:
- Specific OS image:
"sourceImage": "projects/rocky-linux-cloud/global/images/rocky-linux-8-optimized-gcp-v20220719" - Image family:
"sourceImage": "projects/rocky-linux-cloud/global/images/family/rocky-linux-8-optimized-gcp"
When you specify an image family, Compute Engine creates a VMfrom the most recent, non-deprecated OS image in that family. Formore information about when to use image families, seeImage family best practices.
- Specific OS image:
Create a VM with gVNIC support
You can create a VM using one of thesupported public OS images orusing a custom OS image you created using the steps inCreate a custom OS image that supports gVNIC.
Optionally, you canenable DPDK on the VMfor faster network packet processing, low latency, and consistent performance.
For VMs that support multiple network interfaces (NICs), you can have NICs ofdifferent types attached to the VM because interface support is configured perNIC. While this is supported, we don't recommend this setup. For VMs that supportmultiple NICs, ensure that you specifynic-type=GVNIC for each network interfacewhen creating the VM.
Create a VM using a public OS image
To create a VM using a public OS image that supports gVNIC, follow theinstructions atCreating VMs and containers with high-bandwidth configuration.
Create a VM using a custom OS image
If you aren't using a public OS image that supports gVNIC, youmust firstcreate a custom OS image that supports gVNIC.You then use that custom OS image to create a VM by usingtheGoogle Cloud console,Google Cloud CLI, orREST.
Console
In the Google Cloud console, go to theCreate an instance page.
Enter theName of your VM instance.
Select theZone to create your VM in.
In theBoot disk section, clickChange.
In theBoot disk panel, on theCustom images tab, complete the following:
- Choose theSource project that contains the OS image thatyou created previously.
- Select the image from theImage drop-down.
- ClickSelect.
To set gVNIC as the network interface, expand theAdvanced options section, and then do the following:
- Expand theNetworking section.
- ForNetwork interface card, select
gVNIC.
Make additional VM customizations as needed.
ClickCreate to create the VM instance.
gcloud
Create the VM by using the
gcloud compute instances createcommand.For the boot disk, specify the custom OS image that you created earlier.For the network interface, set the value of thenic-typeflag toGVNIC.gcloud compute instances createVM_NAME \ --zone=ZONE \ --machine-type=MACHINE_TYPE \ --image=IMAGE_NAME \ --image-project=YOUR_IMAGE_PROJECT \ --network-interface=nic-type=GVNIC
Replace the following:
VM_NAME: the name of the new VM.ZONE: the zone to create the VM in.MACHINE_TYPE: the machine type to use whencreating the VM instance. If you don't specify a machine type, thedefault isn1-standard-1.IMAGE_NAME: the OS image that was created inthe previous step.YOUR_IMAGE_PROJECT: the name of your projectthat contains the OS image.
Optional: Verify that Compute Engine created the VM and that the
nicTypeis set toGVNIC.gcloud compute instances describeVM_NAME \ --zone=ZONE
Replace the following:
VM_NAME: the name of the VM.ZONE: the zone that you created the VM in.
Example
To create a Rocky Linux 8 VM with an
n1-standard-1machinetype in zoneus-west1-busing an OS image namedmy-gvnic-rocky8that's in projectmy-project-12345, run the following command:gcloud compute instances createmy-rocky-linux-vm \ --zone=us-west1-b \ --image=my-gvnic-rocky8 \ --image-project=my-project-12345 \ --network-interface=nic-type=GVNIC
Things to consider
The
--network-interfaceflag has sub-level flags such as thefollowing:--address: Assign an IP address to the VM--network: The network the interface will be a part of--network-tier: The network tier of the interface--subnet: The subnet that the interface will be part of. If--networkis also specified, the subnet must be a part of the specified network.--private-network-ip: Specify the RFC 1918 IP to assign to the VM.
For a full list see, the
Note: When enabling gVNIC, if you need to set any of these sub-levelflags, you must specify these as a comma separated list to the--network-interfaceflag.--network-interfaceflag. For example,-network-interface=subnet=SUBNET_NAME,nic-type=GVNIC.
REST
Create the VM by using theinstances.insert method.
- For the boot disk, specify the custom OS image that you created earlier.
- For the network interface, set the value of the
nicTypefield toGVNIC.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances{ "name":"VM_NAME", "networkInterfaces":[ { "network":"NETWORK", "nicType":"GVNIC", "subnet":"SUBNET_NAME" } ], "disks":[ { "initializeParams":{ "sourceImage":"projects/YOUR_IMAGE_PROJECT/global/images/IMAGE_NAME" }, "boot":true } ]}Replace the following:
PROJECT_ID: the ID of the project to createthe VM in.ZONE: the zone to create the VM in.VM_NAME: the name of the new VM.NETWORK: the URL of the network resource forthis VM. If neither the network nor the subnetwork is specified, thedefault networkglobal/networks/defaultis used.SUBNET_NAME: name of the subnet. The networkis inferred from the specified subnet. This is an optional field.YOUR_IMAGE_PROJECT: the name of your projectthat contains the OS image.IMAGE_NAME: the OS image that was created inthe previous step.
Verify that gVNIC is enabled
Linux
You can use thelshw tool to extract detailed information about thehardware configuration of the virtual machine.
To install thelshw tool on your Linux VM instance, open a SSH connectionto the VM, and then run the following command:
sudo apt-get install lshw -y
To determine if the VM is using the gVNIC network interface, run thefollowing command:
sudo lshw -class network
The output resembles the following:
*-network description: Ethernet interface product: Compute Engine Virtual Ethernet [gVNIC] vendor: Google, Inc. physical id: 3 bus info: pci@0000:00:03.0 logical name: ens3 version: 00 serial: 42:01:0a:80:00:6f width: 32 bits clock: 33MHz capabilities: msix bus_master cap_list ethernet physical configuration: autonegotiation=off broadcast=yes driver=gve driverversion=1.0.0 duplex=full ip=10.128.0.111 latency=0 link=yes multicast=yes port=twisted pair resources: irq:11 memory:c0203000-c0203fff memory:c0200000-c02000ff memory:c0100000-c01fffff
Windows
- On your Windows VM Instance, open the Device Manager.
- Under Network Adapters, you should see:
"Google Ethernet Adapter"
Troubleshooting
To troubleshoot gVNIC, seeTroubleshooting Google Virtual NIC.
What's next
- Connect to your instance.
- Add persistent disks to your newinstance.
- Configure per VM Tier_1 networking performance.
- Change the MTU setting of a VPC network.
- Learn aboutjumbo frames.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.