Explore information related to virtual machine


Shrink VMDK Virtual Disk Size on VMWare ESXi - Do it Now ?


This article covers how to shrink VMDK Virtual Disk Size on VMWare ESXi.
By default, VMware creates "growable" disks that grow larger in size as you add data.

Unfortunately, they don't automatically shrink when you remove data.
You'll need to clean up or compact your disks to actually free up space on your hard drive.

VMware Workstation also allows you to create snapshots, which contain a complete "snapshot" of a virtual machine's state at the point in time you created them.
These can take a lot of space if the virtual machine has changed significantly since then.
You can free up additional space by deleting snapshots you no longer need.

1. To view the snapshots for a virtual machine, select the virtual machine in VMware Workstation and click VM > Snapshot > Snapshot Manager.
2. To delete a snapshot you no longer need, right-click it in the Snapshot Manager window and select "Delete". It will be removed from your computer.
3. You won't be able to restore your virtual machine to that previous point in time after deleting the snapshot, of course.

Before we try to shrink the virtual disk files, we should try to remove any unneeded files from the virtual machine to free space.

For example, on Debian-based VMs, you can run:

$ apt-get clean

To clear out the local repository of retrieved package files.
Next, run the command below to fill the unused space with zeros:

cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill


Free Disk Space In VMware Workstation

In VMware Workstation, first power off the virtual machine you want to compact. You can't complete this process if it's powered on or suspended.
1. Select the virtual machine you want to compact in the main window and click VM > Manage > Clean Up Disks.
2. The tool will analyze the selected virtual machine's disk and show you how much space you can reclaim.
To reclaim the space, click "Clean up now".
If no space can be freed, you'll see a "Cleanup is not necessary" message here instead.

Read More



The source file names are larger than is supported by the file system


This article covers methods to resolve Windows error "The source file names are larger than is supported by the file system". Most Windows users encounter this issue when trying to copy or delete a file on the computer and they may receive an error message saying Source Path Too Long with the explanation of the source file name(s) are larger than is supported by the file system.


This Windows error error happens mainly because one or more files that are kept in a series of subfolders that have long names, but Windows only allows 258 characters at most in the folder path subfolder.
This will prevent you from moving the files or folders that are saved in this folder.

To fix this windows error, try the following:

Delete the File/Folder by Bypassing the Recycle Bin
You know that when you delete files from your computer, these files will be first moved to the Recycle Bin and they will stay there until you delete them permanently.
i. Click on the file or folder that is bothered by the Source Path Too Long error.
ii. Press the SHIFT and Delete buttons at the same time to permanently delete the file or folder.

Read More



WDS deployment in Virtual machines – Few test cases


This article covers some methods to test Windows deployment in virtual machines. Windows Deployment Services (WDS) enables you to deploy Windows operating systems over the network, which means that you do not have to install each operating system directly from a CD or DVD.


To install Windows Deployment Services:

Windows Deployment Services ships as an innate role of Windows Server. I will be demonstrating on WS2016. All currently-supported versions provide it and you follow nearly the same process on each of them.

1. Start in Server Manager. Use the Add roles and features link on the main page (Dashboard) or on the Manage drop-down.

2. Click Next on the introductory page.

3. Choose Role-based or feature-based installation.

4. On the assumption that you're running locally, you'll only have a single server to choose from. If you've added others, choose accordingly.

5. Check Windows Deployment Services.

6. Immediately upon selecting Windows Deployment Services, you’ll be asked if you’d like to include the management tools. Unless you will always manage from another server, leave the box checked and click Add Features.

7. Click Next on the Select server roles page and then click Next on the Select server features page (unless you wish to pick other things; no others are needed for this walkthrough).

8. You'll receive another informational screen explaining that WDS requires further configuration for successful operation. Read through for your own edification. You can use the mentioned command line tools if you like, but that won't be necessary.

9. You will be asked to select the components to install. Leave both Deployment Server and Transport Server checked.

10. Click Install on the final screen and wait for the installation to finish.


To create WDS Boot Images:

When a system starts up and PXE directs it to the WDS server, it first receives a boot image. The boot image should match the operating system it will deploy.

You can obtain one easily.

1. Find the DVD or ISO for the operating system that you want to install. Look in its Sources folder for a file named boot.wim. 

2. On your WDS server, right-click the Boot Images node and click Add Boot Image.

3. On the first page of the wizard, browse to the image file. You can load it right off the DVD as it will be copied to the local storage that you picked when you configured WDS.

4. You’re given an opportunity to change the boot image’s name and description. I would take that opportunity, because the default Microsoft Windows Setup (x##) won’t tell you much when you have multiples.

5. You will then be presented with a confirmation screen. Clicking Next starts the file copy to the local source directory. After that completes, just click Finish.

Read More



Virtualization Restrictions in RedHat Linux with KVM


This article covers Virtualization Restrictions in RedHat Linux which are additional support and product restrictions of the virtualization packages.


The following notes apply to all versions of Red Hat Virtualization:

1. Supported limits reflect the current state of system testing by Red Hat and its partners. Systems exceeding these supported limits may be included in the Hardware Catalog after joint testing between Red Hat and its partners. If they exceed the supported limits posted here, entries in the Hardware Catalog are fully supported. In addition to supported limits reflecting hardware capability, there may be additional limits under the Red Hat Enterprise Linux subscription terms. Supported limits are subject to change based on ongoing testing activities.


2. These limits do not apply to Red Hat Enterprise Linux (RHEL) with KVM virtualization, which offers virtualization for low-density environments.


3. Guest operating systems have different minimum memory requirements. Virtual machine memory can be allocated as small as required.

Read More



Boot a guest using PXE - Do it now


This article covers how to boot a guest using PXE. PXE booting is supported for Guest Operating Systems that are listed in the VMware Guest Operating System Compatibility list and whose operating system vendor supports PXE booting of the operating system.

The virtual machine must meet the following requirements:

1. Have a virtual disk without operating system software and with enough free disk space to store the intended system software.

2. Have a network adapter connected to the network where the PXE server resides.


A virtual machine is not complete until you install the guest operating system and VMware Tools. Installing a guest operating system in your virtual machine is essentially the same as installing it in a physical computer.


To use PXE with Virtual Machines:

You can start a virtual machine from a network device and remotely install a guest operating system using a Preboot Execution Environment (PXE). 

You do not need the operating system installation media. When you turn on the virtual machine, the virtual machine detects the PXE server.


To Install a Guest Operating System from Media:

You can install a guest operating system from a CD-ROM or from an ISO image. Installing from an ISO image is typically faster and more convenient than a CD-ROM installation. 


To Upload ISO Image Installation Media for a Guest Operating System:

You can upload an ISO image file to a datastore from your local computer. You can do this when a virtual machine, host, or cluster does not have access to a datastore or to a shared datastore that has the guest operating system installation media that you require.


How to Use a private libvirt network ?

1. Boot a guest virtual machine using libvirt with PXE booting enabled. You can use the virt-install command to create/install a new virtual machine using PXE:

virt-install --pxe --network network=default --prompt

2. Alternatively, ensure that the guest network is configured to use your private libvirt network, and that the XML guest configuration file has a <boot dev='network'/> element inside the <os> element, as shown in the following example:

<os>

   <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>

   <boot dev='network'/>

   <boot dev='hd'/>

</os>

3. Also ensure that the guest virtual machine is connected to the private network:

<interface type='network'>

   <mac address='52:54:00:66:79:14'/>

   <source network='default'/>

   <target dev='vnet0'/>

   <alias name='net0'/>

   <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>

</interface>

Read More



Create CentOS Fedora RHEL VM Template on KVM - How to do it


This article covers how to create CentOS/Fedora/RHEL VM Templates on KVM. VM Templates are more useful when deploying high numbers of similar VMs that require consistency across deployments. If something goes wrong in an instance created from the Template, you can clone a fresh VM from the template with minimal effort.


To install KVM in your Linux system:

The KVM service (libvirtd) should be running and enabled to start at boot.

$ sudo systemctl start libvirtd

$ sudo systemctl enable libvirtd

Enable vhost-net kernel module on Ubuntu/Debian.

$ sudo modprobe vhost_net

# echo vhost_net | sudo tee -a /etc/modules


How to Prepare CentOS / Fedora / RHEL VM template ?

1. Update system

After you finish VM installation, login to the instance and update all system packages to the latest versions.

$ sudo yum -y update

2. Install standard basic packages missing:

$ sudo yum install -y epel-release vim bash-completion wget curl telnet net-tools unzip lvm2 

3. Install acpid and cloud-init packages.

$ sudo yum -y install acpid cloud-init cloud-utils-growpart

$ sudo sudo systemctl enable --now acpid

4. Disable the zeroconf route

$ echo "NOZEROCONF=yes" | sudo tee -a /etc/sysconfig/network

5. Configure GRUB_CMDLINE_LINUX – For Openstack usage.

If you plan on exporting template to Openstack Glance image service, edit the /etc/default/grub file and configure the GRUB_CMDLINE_LINUX option. Your line should look like below – remove rhgb quiet and add console=tty0 console=ttyS0,115200n8.

GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap console=tty0 console=ttyS0,115200n8"

Generate grub configuration.

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

6. Install other packages you need on your baseline template.

7. When done, power off the virtual machine.


How to Clean VM template ?

You need virt-sysprep tool for cleaning the instance.

$ sudo virt-sysprep -d centos7

Read More



PXE Boot or DHCP Failure on Guest - Fix it now


This article covers how to fix PXE Boot (or DHCP) Failure on Guest.

Nature of this error:

A guest virtual machine starts successfully, but is then either unable to acquire an IP address from DHCP or boot using the PXE protocol, or both. There are two common causes of this error: having a long forward delay time set for the bridge, and when the iptables package and kernel do not support checksum mangling rules.


Cause of PXE BOOT (OR DHCP) ON GUEST FAILED:

Long forward delay time on bridge.

This is the most common cause of this error. If the guest network interface is connecting to a bridge device that has STP (Spanning Tree Protocol) enabled, as well as a long forward delay set, the bridge will not forward network packets from the guest virtual machine onto the bridge until at least that number of forward delay seconds have elapsed since the guest connected to the bridge. This delay allows the bridge time to watch traffic from the interface and determine the MAC addresses behind it, and prevent forwarding loops in the network topology. If the forward delay is longer than the timeout of the guest's PXE or DHCP client, then the client's operation will fail, and the guest will either fail to boot (in the case of PXE) or fail to acquire an IP address (in the case of DHCP).


Fix to PXE BOOT (OR DHCP) ON GUEST FAILED:

If this is the case, change the forward delay on the bridge to 0, or disable STP on the bridge.

This solution applies only if the bridge is not used to connect multiple networks, but just to connect multiple endpoints to a single network (the most common use case for bridges used by libvirt).


If the guest has interfaces connecting to a libvirt-managed virtual network, edit the definition for the network, and restart it. 

For example, edit the default network with the following command:

# virsh net-edit default

Add the following attributes to the <bridge> element:

<name_of_bridge='virbr0' delay='0' stp='on'/>

XML


If this problem is still not resolved, the issue may be due to a conflict between firewalld and the default libvirt network.

To fix this, stop firewalld with the service firewalld stop command, then restart libvirt with the service libvirtd restart command.

Read More



Install OpenBSD As Guest Operating System using KVM virt-install


This article covers how to install OpenBSD as guest operating while using KVM. OpenBSD is well know for focus on security features such as Memory protection, cryptography, randomization and much more in default base installation.
virt-install provides the option of supporting graphics for the guest operating system installation. This is achieved through use of QEMU.

virt-install is a command line tool for creating new KVM, Xen, or Linux container guests using the libvirt hypervisor management library
The virt-install tool provides a number of options that can be passed on the command line.

To see a complete list of options run the following command:
# virt-install --help

Read More



Troubleshoot KVM Virtualization Problem


This article covers how to troubleshoot KVM virtualization problem.


Log file locations and tools used to track down #KVM #problems are:
1. $HOME/.virtinst/virt-install.log – virt-install tool log file.
2. $HOME/.virt-manager/virt-manager.log – virt-manager tool log file.
3. /var/log/libvirt/qemu/ – Log files for each running virtual machine. If centos is virtual machine name, than log file is /var/log/libvirt/qemu/centos.log.

You can use the grep and other Linux tools to view this files:
# tail -f /var/log/libvirt/qemu/freebsd.log
# grep something $HOME/.virtinst/virt-install.log
$ sudo tail -f /var/log/libvirt/qemu/openbsd.log

Hyper-V backups can fail for any number of reasons, but there are some things to look for when backups don’t work the way that they are supposed to.
When backups fail, the first thing that you should do is to check the backup logs in an effort to learn more about the problem.
Specifically, you need to determine if the problem is confined to a particular host, a particular virtual machine, or perhaps related to the backup target itself.

Read More



Create a virtual machine using lightsail in AWS


This article will guide you on how to create a virtual #machine using Lightsail in #AWS.

#Lightsail is an easy-to-use virtual private server (#VPS) that offers you everything needed to build an application or website, plus a cost-effective, monthly plan.

To create a virtual machine in #cloud:

1. Using the left-hand navigation bar, click Compute Engine and then select #VM instances from the item list. 

2. If this is your first #VM on the platform. 

3. If you have a VM template you can import it to GCP, but in this case we will create a VM from scratch.

Read More



Reset Windows Administrator Password from Hyper-V


This article will guide you on steps to reset the forgotten #Windows Administrator password from Hyper-V using an #ISO file.

Microsoft's Hyper-V virtualization can greatly reduce cost of operations. By purchasing a few very powerful #servers you can virtualize all or most of your entire infrastructure while reducing the cost of #hardware and maintenance.

To Reset Lost Admin Password for Hyper-V Virtual #Machine:

1. Select the administrator account, then click the Reset Password button to reset the password to blank. 

2. Click the Restart button to reboot the virtual machine, you are able to log in to the administrator account with a blank password.

Read More



Steps to Deploy Virtual Machines in RHEV Environment


This article will guide you on how to #deploy #virtual #machines in the #RHEV environment and also on #Linux and #Windows virtual machines.

A Virtual Machine (#VM) is a compute resource that uses software instead of a physical computer to run programs and deploy apps. One or more virtual "guest" #machines run on a physical "host" machine.

The main purpose of VMs is to operate multiple operating systems at the same time, from the same piece of hardware. Without virtualization, operating multiple systems — like Windows and Linux — would require two separate physical units.

The two basic types of virtual machines are process and system VMs:

1. A process virtual machine allows you to run a single process as an application on a host machine. 

2. A system virtual machine is a fully virtualized #VM designed to be a substitute for a physical machine.

Your virtual machine internet connection goes through your computer and through your router. So they can track your router's #IP address, and possibly track you down at least to your city, if not to individual street or house.

Read More



Guide to install Red Hat Enterprise Linux 7 3


This article will guide you on the step by step process to install Red Hat Enterprise Linux 7.3. This involves completing the “Installation Summary” window along with the installation of #VMware #Workstation and creation of a virtual machine.

Red Hat® Enterprise Linux® is the world's leading enterprise #Linux platform. * It's an open source operating system (#OS). It's the foundation from which you can scale existing apps—and roll out emerging technologies—across bare-metal, virtual, container, and all types of cloud environments.

Read More



Virtual Machines (VMs) in oVirt 4 0 Environment


This article will guide you on the steps to create a Virtual Machines (#VMs) in oVirt 4.0 Environment.

The #oVirt engine acts as the control center for oVirt environments. The engine enables admins to define #hosts and #networks, as well as to add storage, create VMs and manage user permissions. Included in the oVirt engine is a graphical user interface (GUI), which manages oVirt #infrastructure resources.

To Create a Virtual Server:

i. Access the Virtual Server class tab in the Class #Manager.

ii. Click the Add Virtual Server link.

iii. Specify the name of the virtual server, its connections, and the URL Hosts. ...

iv. Click OK and then Apply to save and apply your changes.

To to Create Virtual Machines (VMs) in oVirt 4.0 Environment:

1. Create new Data Center.

2. Configure Cluster for Data Center.

3. Add Host or oVirt Node to above created data center & cluster.

4. Creating Storage #Domains.

5. Upload #ISO files to ISO Storage Domain.

6. Create Virtual Machine.

Read More



Cloning existing KVM virtual machine images on Linux


This article will guide you on how to use the virt-clone command which provides a number of options to clone a #KVM #VM. You can use the virt-sysprep if you need to clone the VM and make/reset anything inside the guest #OS.

Read More



Selecting the number of vCPUs and Cores for a Virtual Machine


This articles will guide you when selecting the number of vCPUs and Cores for a Virtual Machine which depends on the operating system used and some other factors.

Basically, When Selecting the Number of #vCPUs and #Cores for a Virtual Machine, you can use all CPU #resources allocated to a virtual machine, it must see one 8 core #processor, 2 vCPUs with 4 cores each or 1 vCPU with 4 cores in two threads instead of 8 vCPUs.

Read More



Invalid State of a Virtual Machine on VMWare ESXi


This article will guide you on the steps to resolve the Invalid State of a Virtual Machine on VMWare #ESXi error which relates to #orphaned virtual machines.

A virtual machine can show up as invalid or orphaned in these situations. After a vMotion or #VMware DRS migration. After a VMware HA #host failure occurs, or after the #ESX host comes out of maintenance mode. A virtual machine is deleted outside of vCenter Server. #vCenter Server is restarted while a migration is in progress.

Read More



VMWare how to find VMS by IP or MAC address


This tutorial will guide you on how to easily find VMS by IP or mac address.

Read More



Steps to kill an unresponsive Virtual Machine


This article will guide you through the steps to kill an unresponsive Virtual Machine in VMWare ESXi.

Read More



Fix Hyper V VM Stuck in the Stopping Starting State


Basically, if our virtual machine running on Hyper-V is stuck for some reason, the only way out is to forcibly kill the process responsible for this VM on the host OS.

Read More



Failure to unmount or delete VMFS Datastore the resource is in use


This article will guide you on how to solve the error “unable to unmount/delete vmfs datastore: the resource is in use” triggers while removing an empty VMFS Datastore in VMWare vSphere.

Read More



Vmware virtual machine disks consolidation is needed error


This guide will help you to fix the warning error experienced in the process of deleting a snapshot, the snapshot VMDK files or logs have not been deleted correctly.

Read More



Solution to error VMWare virtual machine disks consolidation is needed


This article will help you to fix the warning error "VMWare: virtual machine disks consolidation is needed" experienced when trying to delete a snapshot, the snapshot VMDK files or logs have not been deleted correctly.

Read More



KVM Installation on CentOS 7


This article will guide you through the process of installing kernel-based virtual machine (KVM) on your CentOS 7 machine.

Read More



Fix Unable to access file since it is locked error on vmware


This article will guide you through the steps you need to take to fix the VMWare "Unable to access a file since it is locked" error by restarting the Management Agent or ESXi host.

Read More




For Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on LinuxAPT.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com






Focus on your business, not your servers.

Click Here to Learn More