Total Pageviews

Saturday, August 5, 2023

Paravirtualized Network Adaptor: Changing E1000e to VMXNET3:

A very common and misleading practice made by many is to accept the default value during installation or configuration. This practice may be acceptable or even suitable in some scenarios, but it may not be optimal for a targeted workload since the default values can eventually cause widespread performance issues.

While creating a Virtual Machine in vSphere ESXi, there are many mandatory values come as default for CPU, Memory, Network Card, Socket, I/O controller and so on that need to be decided on. The VMware architect sets most of the required hardware resources at the bare minimum values necessary to create a Virtual Machine regardless of the guest OS. Should we accept these defaults? Probably not. However, many administrators and associates continue to accept these bare minimum hardware default values without realizing the performance consequences.

Network Adaptor: Currently there are three types of Network Adaptors available and the E1000e is the default. E1000e is an emulated version of the “Intel 82574 Gigabit Ethernet NIC” and the guest OS will recognize it as “Intel(R) 82574L Gigabit Network Connection”. If this adaptor is selected for the guest OS (Windows, Linux), the required driver for this adaptor is already built-in within the OS and has no interaction with VMWare Tools driver.

A few disadvantages of E1000e:

1.     It is not Paravirtualized, thus VM performance is not guaranteed.

2.     Only supports basic network connectivity.

3.     Does not support RSS (Receive Side Scaling).

4.     Uses far more CPU on the hypervisor.

5.     May cause memory leakage and high CPU on the guest OS.

6.     Network packets drop.

VMXNET3: It is a Paravirtualized Network Adaptor developed by VMWare and it is recommended for VM to gain substantial performance benefit from the Virtual Machine. To take advantage of this adaptor, VMWare Tools need to be installed on the Virtual Machine.

Changing E1000e to VMXNET3: There are several ways to change the Network Adaptor type from E1000e to VMXNET3. Before doing this, you should record all network configurations from the existing network adaptor. If you would like to keep the MAC address of the of E1000e (existing network card), please write it down beforehand.

I found that using PowerCLI is the easiest and safest way to change the network adaptor type from E100e to VMXNET3.

Method 1: Using PowerCLI to change NIC type while preserving the original MAC address of E1000e:

·       Note down the network configuration, including values such as IP, subnet, Gateway, DNS, etc. and take a snapshot of the VM.

·       Turn off the VM.

·       Connect to the Esxi Server, my Esxi server IP is 192.168.0.22:

 Connect-VIServer -Server 192.168.0.22

·       Check the Network Type:

Get-VM win01| get-networkadapter

·       Change the NIC type from E1000e to VMXNET3:

get-vm win01 | Get-NetworkAdapter | set-networkadapter -type vmxnet3 -confirm:$false

·       Turn on the VM.

·       In a Windows VM, open the device manager (devmgmt.msc) and enable “Show hidden devices” under the view menu.

·       Uninstall the “Intel(R) 82574L Gigabit Network Connection”.

Using PowerCLI to change Network Adaptor:



Method 2: By editing the vmx file:

·       Similar to above, note down the network configuration details.

·       Take a snapshot of the VM.

·       Turn off the VM.

·       Open the datastore where the VM resides.

·       Right click and download the vmx file to local desktop.

·       Edit the vmx file and replace the adaptor type to vmxnext3 as follows: 

ethernet0.virtualDev = "vmxnet3"

·       Add the following:

ethernet0.CheckMACAddress = "FALSE"

·       Save the vmx file, then upload the edited version and replace the original version.

·       Turn on the VM.

·       In a Windows VM, open the device manager (devmgmt.msc) and enable “Show hidden devices” under the view menu.

  • Uninstall the “Intel(R) 82574L Gigabit Network Connection”.

Reference:

Choosing a network adapter for your virtual machine (1001805):

https://kb.vmware.com/s/article/1001805

Understanding full virtualization, paravirtualization, and hardware assist:
https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/VMware_paravirtualization.pdf

VMXNET3 vs E1000E and E1000:

https://rickardnobel.se/vmxnet3-vs-e1000e-and-e1000-part-1/

https://rickardnobel.se/vmxnet3-vs-e1000e-and-e1000-part-2/

Tuesday, June 8, 2021

Accessing Linux Desktop/Server from Windows remotely: using RDP and xRDP

The graphical Remote Desktop Connection is one of the most common methods of working on a Remote Windows based Server or Desktop for Windows users. All Microsoft Windows editions have built-in support for RDP on Windows OS. Doing RDP from a Windows to a Linux environment is easy but requires a few configurations on the remote Linux Server/Desktop.

XRDP: It is a popular Linux open source development that brings several Windows-like features, such as the following:

  • Two-way clipboard transfer (text, bitmap, file)
  • Audio redirection
  • Drive redirection (mount local client drives on remote machine)
  • RDP transport is encrypted using TLS by default

The following configuration steps can be used on all RPM based Linux distributions, such as Red Hat, Fedora, CentOS, and Oracle Linux. For this tutorial, we will be using “Rocky Linux 8.4 RC1 (https://rockylinux.org) - An alternative Linux to CentOS”. Please note that this distribution is not ready for production use yet, but the method described here is applicable to all other Linux.

Step-by-step guide:

Suppose the hostname of the Linux Server is “RockyLinux01 – 192.168.0.15”. We want to RDP to this server from a Window 10 Desktop.

  • Login as root on the Linux Server/Desktop.
  • If the GNOME Desktop Environment has not been installed already, install the GNOME Package using the following command:

   dnf groupinstall 'Server with GUI'

Installing GNOME package

  • Enable the EPEL repository for XRDP package:

   dnf install epel-release

  • Install the XRDP package:

   dnf install xrdp

  • Enable and start the XRDP service:

   systemctl enable xrdp

   systemctl start xrdp
  • Add the exec gnome-session to the /etc/xrdp/xrdp.ini. You can open the xrdp.ini file using vi, nano or any other text editor. I use nano:

   nano /etc/xrdp/xrdp.ini

Editing xrdp.ini

  • Add a firewall rule to allow the RDP port 3389 to pass through:

   firewall-cmd --add-port=3389/tcp --permanent

   firewall-cmd --reload
  • Restart the XRDP service:

   systemctl restart xrdp

  • Check if everything is running as expected:

    systemctl status xrdp

    netstat –atnp | grep 3389
 
xrdp service status on Linux
  • Open the Windows Remote Desktop Connection app and log on to the server. Following are some screenshots using XRDP.

 Screenshots:

Microsoft RDP

xrdp login window on Linux
Using Microsft RDP to login to a Linux

 References: