ORA-12560: TNS:protocol adapter error

Few “years” back, while it was almost impossible to install Oracle 10g on Windows 7/8, I made some attempts & managed to install 32Bit versions of 10g 10.2.0.3.x successfully. A particular release 10.2.0.4 had helluva of issues, mainly TNS related & I can see many visits to that thread even today! I believe, those visitors are not coming over there for 10g, instead for TNS.

On Windows, the below is a typical situation & we’ll see the primary reasons for the same.

Microsoft Windows [Version 10.0.22000.556]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\system32>sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 21 07:59:29 2022
Version 19.11.0.0.0

Copyright (c) 1982, 2020, Oracle.  All rights reserved.

ERROR:
ORA-12560: TNS:protocol adapter error


Enter user-name:

On Windows, everything is another service. So we’ll start with checking whether the “Oracle” service for the database instance has started.

I’m using Oracle database on my laptop mostly for learning purposes, hence the service startup is set as “Manual”. This gives me control over the resources consumed by the database. Not just the service, I have setup the instance to start manual to insure Oracle service doesn’t open the database automatically. Latest Windows OS that use quick boot will save the state of the service, hence you might find your database readily available once after a reboot, although you set everything as manual :)

Let’s see what happens after starting the “Oracle Service”.

Well, that fixes one of the many reasons for the dreaded ORA-12560: TNS:protocol adapter error! As soon I am hit with another, will amend this post.

Restore RMAN backup to same host with same database name | Windows

I think I have mentioned few times already that I am not a certified (Certifitted as we call it sarcastically due to the pure ignorance of much of them) DBA, yet I love executing experiments with Oracle database technology and come up with some hacks, tricks etc. As usual, whatever you read ahead is NOT recommended for PRODUCTION environment and if you end up setting up something that works finally for your PRODUCTION instance, well you are sole responsible for it.

For this experiment, we will use one 19c database with multitenant structure installed on Windows 10/11. Before you attempt the below, please make sure that you have taken the backup of control file trace, spfile copy as pfile and a full backup of database using RMAN

Control file backup trace.

SQL>alter database backup controlfile to trace as 'D:\folder_name\control.txt';

SPfile to Pfile (This file should be available at $ORACLE_HOME\database\ folder)

SQL>create pfile from spfile;

Creating pfile is not mandatory incase if you are restoring the backup to same host and the paths are intact. Pfile becomes useful when you are restoring the database to another host with same directory structure.

Shutdown the database & delete the datafile from paths. For example, my datafiles were in the following paths.

There were three paths from which I needed to delete the data files. From CDB root, PDB seed and PDB itself. You should get a clear idea of the exact locations for your data files from the control file trace export.

Once after deleting the files, start the database at nomount state. The latest version of databases allow you to execute many SQL commands from RMAN itself, however, I always prefer SQL prompt for SQL activities. Suite yourself.

SQL>startup nomount

From another command/terminal window connect to RMAN

D:\RMAN>rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Mar 12 11:47:15 2022
Version 19.11.0.0.0

Copyright (c) 1982, 2021, Oracle and/or its affiliates.  All rights reserved.

connected to target database: SCTCDB (not mounted)

Restore the control file from latest backup

RMAN> restore controlfile from 'D:\RMAN\BKPCONTROL_FILE.CTL_SCTCDB_20220312';

Starting restore at 12-MAR-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=498 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\ORACLE19C\DB\ORADATA\SCTCDB\CONTROL01.CTL
output file name=D:\ORACLE19C\DB\ORADATA\SCTCDB\CONTROL02.CTL
Finished restore at 12-MAR-22

Now try to mount the database.

RMAN> alter database mount;

released channel: ORA_DISK_1
Statement processed

Once the database mounted, let us see what the schema reprorts

RMAN> report schema;

Populate catalog from the backup.

RMAN> catalog start with 'D:\RMAN';

searching for all files that match the pattern D:\RMAN

List of Files Unknown to the Database
=====================================
File Name: D:\RMAN\BKPCONTROL_FILE.CTL_SCTCDB_20220312

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: D:\RMAN\BKPCONTROL_FILE.CTL_SCTCDB_20220312

Once the above completes successfully, we can proceed with restoring the backup.

RMAN> run
2> {allocate channel ch1 device type disk;
3> restore database;
4> switch datafile all;
5> switch tempfile all;
6> release channel ch1;
7> }

allocated channel: ch1
channel ch1: SID=252 device type=DISK

Starting restore at 12-MAR-22

channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00004 to D:\ORACLE19C\DB\ORADATA\SCTCDB\UNDOTBS01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_040O6TG6_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_040O6TG6_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:03
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00003 to D:\ORACLE19C\DB\ORADATA\SCTCDB\SYSAUX01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_020O6TG5_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_020O6TG5_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:15
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00005 to D:\ORACLE19C\DB\ORADATA\SCTCDB\PDBSEED\SYSTEM01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_050O6TG9_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_050O6TG9_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:15
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00009 to D:\ORACLE19C\DB\ORADATA\SCTCDB\SCT\SYSTEM01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_030O6TG5_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_030O6TG5_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:15
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00011 to D:\ORACLE19C\DB\ORADATA\SCTCDB\SCT\UNDOTBS01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_080O6TH9_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_080O6TH9_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:01
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00010 to D:\ORACLE19C\DB\ORADATA\SCTCDB\SCT\SYSAUX01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_060O6TH2_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_060O6TH2_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:07
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00007 to D:\ORACLE19C\DB\ORADATA\SCTCDB\USERS01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_0B0O6THG_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_0B0O6THG_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:01
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00008 to D:\ORACLE19C\DB\ORADATA\SCTCDB\PDBSEED\UNDOTBS01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_090O6THA_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_090O6THA_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:07
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00012 to D:\ORACLE19C\DB\ORADATA\SCTCDB\SCT\USERS01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_0C0O6THH_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_0C0O6THH_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:02
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00006 to D:\ORACLE19C\DB\ORADATA\SCTCDB\PDBSEED\SYSAUX01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_070O6TH9_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_070O6TH9_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:07
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00001 to D:\ORACLE19C\DB\ORADATA\SCTCDB\SYSTEM01.DBF
channel ch1: reading from backup piece D:\RMAN\SCT_SCTCDB_ LVL0_010O6TG5_1_1
channel ch1: piece handle=D:\RMAN\SCT_SCTCDB_ LVL0_010O6TG5_1_1 tag=DAILYFULL_DB_LVL0_BKP
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:35
Finished restore at 12-MAR-22



released channel: ch1

With the above restore, I used only one channel, please adjust based on available hardware resources. Once the backup completes, we can recover the database using the available archive logs. For that you need to know what is the latest available sequence number.

RMAN> list backup of archivelog all;

From the image above, you could see that the latest Sequence number for the SCN is 20, however the listing is kind of confusing (remember I am not a DBA, however eventually I will figure out why the listing is messed up). Once the latest sequence number identified, we can try to recover until last sequence + 1

RMAN> run {
2> allocate channel ch1 device type disk;
3> allocate channel ch2 device type disk;
4> allocate channel ch3 device type disk;
5> allocate channel ch4 device type disk;
6> recover database until sequence 21;
7> release channel ch1;
8> release channel ch2;
9> release channel ch3;
10> release channel ch4;
11> }

allocated channel: ch1
channel ch1: SID=252 device type=DISK

allocated channel: ch2
channel ch2: SID=128 device type=DISK

allocated channel: ch3
channel ch3: SID=375 device type=DISK

allocated channel: ch4
channel ch4: SID=499 device type=DISK

Starting recover at 12-MAR-22

starting media recovery

archived log for thread 1 with sequence 19 is already on disk as file D:\ORA\ARCH\SCT0000000019_1096219042_0001.ARC
archived log for thread 1 with sequence 20 is already on disk as file D:\ORA\ARCH\SCT0000000020_1096219042_0001.ARC
archived log file name=D:\ORA\ARCH\SCT0000000019_1096219042_0001.ARC thread=1 sequence=19
archived log file name=D:\ORA\ARCH\SCT0000000020_1096219042_0001.ARC thread=1 sequence=20
media recovery complete, elapsed time: 00:00:01
Finished recover at 12-MAR-22

released channel: ch1

released channel: ch2

released channel: ch3

released channel: ch4

Finally, we can open the database resetting online redo log files

RMAN> alter database open resetlogs;

Database MUST open without creating any issues at this stage. Continue checking for the database vitals.

Linux | Folder permissions for group

Let us see how we can create and give a group write permission for a folder on Linux environment. This becomes helpful when you want to keep downloaded files accessible to multiple users. Very helpful if you are dealing with Oracle EBS like applications that has different users for both database and application.

[root@erp-test /]# mkdir -p orapatches


--Change group ownership for the newly created folder.
[root@erp-test /]# chgrp -R oinstall /orapatches


--Finally change the mode so that all the members in this group could write to this folder.

[root@erp-test /]# chmod g+w /orapatches

Hope this helps few newbies out there!

Oracle RMAN | RMAN-03009 | ORA-19571| archived log RECID not found

We recently migrated from Oracle 11gR2 to 19c for our Oracle Applications (12.2.10) & decided to continue with old RMAN plans. Run a shell script, call RMAN as “Oracle” user, copy current day backups to a remote server & finalizing the activities with email sent.

Our previous database compressed RMAN backups were a maximum of 142GB per day, that grew to 190-192GB (few datafiles were added) after the upgrade. This made us to reduce the retention period from 7 to 5 and next day, while going through the RMAN logs, I found the following error.

released channel: c1
released channel: c2
released channel: c3
released channel: c4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================

RMAN-03009: failure of backup command on c4 channel at 02/10/2022 22:24:51
ORA-19571: archived log RECID 416 STAMP 1095631214 not found in control file

RMAN> 

Recovery Manager complete.

So, I went through the previous days logs and found this error started being logged from 9th of Feb and rest were all okay.

I checked database “control_file_record_keep_time” parameter and found the value set as “7” which was more than our current backup retention period.

So the next factor to check was the RMAN script that we were using over a period of 6-7 years without a single failure.

export PATH=$ORACLE_HOME/bin:$PATH
export LAST_RMANLOG_FILE="rman_dailyfull`date +%d%m%y`.log"
echo "Starting Full Daily Database Backup of oracle ebsr12 PROD database"
date
rman target / << EOF >/u03/RMAN/log/rman_dailyfull`date +%d%m%y`.log
run
{
ALLOCATE CHANNEL c1 DEVICE TYPE disk;
ALLOCATE CHANNEL c2 DEVICE TYPE disk;
ALLOCATE CHANNEL c3 DEVICE TYPE disk;
ALLOCATE CHANNEL c4 DEVICE TYPE disk;
crosscheck archivelog all;
crosscheck backup;
BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT '/u03/RMAN/DAILYBKP/rman_comp_%d_lvl0_%U' TAG "dailyfull_db_lvl0_bkp" INCLUDE CURRENT CONTROLFILE;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP AS COMPRESSED BACKUPSET ARCHIVELOG ALL FORMAT '/u03/RMAN/DAILYBKP/archive_%d_lvl0_%U';
DELETE NOPROMPT archivelog all completed before 'sysdate-7';
backup current controlfile format '/u03/RMAN/DAILYBKP/bkpcontrol_file.ctl_%d_%T';
DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 5 DAYS;
RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
RELEASE CHANNEL c3;
RELEASE CHANNEL c4;
}
EOF

After a close reading, I found the typo. I was deleting the obsolete backups within a window of 5 days & trying to delete logs which were “7” days old.

DELETE NOPROMPT archivelog all completed before 'sysdate-5';

That’s all. No more RMAN-03009, ORA-19571, or archived log RECID <NNN> STAMP <NNNNNNNNNN> not found in control file errors.

Oracle VirtualBox Guest Addons | kernel headers not found for target kernel

So how many Oracle VirtualBox VM (Virtual Machine)s you do have?

I’ve many. I try many new software & not to break production box, I try them using Virtual Machines. I use Oracle VirtualBox (mostly) for both Windows and Linux machines (and VMWare ESXi for Production servers), as you could see with the above image. VirtualBox and VMWare supply additional software called “Guest Additions” that synchronize the Guest Virtual Machines with Host machine seamlessly. Like Mouse integration that allows your mouse to travel between both host and guest machines without any difficulties.

On Linux OS, installing the Guest Additions could be sometimes challenging. Especially with Oracle Linux that uses UEK kernels. Let us see how to “fix” the common error messages that appears when installing the Guest Additions on Oracle Linux 7 and 8.

The best approach is to update your Linux OS with latest patches before trying the below. I consider you already updated your Linux box, if yes then

yum install kernel-uek-devel

is enough to install the devel package, suffice the kernel headers missing error. Install the package, reboot the box and try to install VirtualBox Guest Additions. This time module should get installed properly. You may need make, gcc & perl already installed for a successful installation of Guest Additions. You will find instructions to install them later in the article.

Now we have another situation when guest add-ons are required, however updating the new Linux box is not possible due to many reasons. Here we will use the Linux OS ISO image. Please note, the ISO file that you are going to use must be the same ISO that you used to install OS and OS was not updated at all. That means your Linux box is as it is after the OS installation.

Attach the ISO file to your Linux box & Switch to

Packages folder for Oracle Linux 7 and “BaseOS\Packages” for Linux 8

Now locate the kernel-uek-devel-xxxxxxxxxxxxxxxxxxxx package and install it. For example, I will execute the following for Linux 8

rpm -ivh kernel-uek-devel-5.4.17-2136.300.7.el8uek.x86_64.rpm

That’s it. Restart the box and try to install the guest add-ons once again and you must be through without other issues. You might need to install gcc, make & perl also to get the guest add-ons installed.

If you are connected to internet, you can install the above packages by issuing the command

yum install gcc make perl -y

Or go through the packages available in the Packages repo, install them.

All the best!

KB5009543 | Jan 2022 cumulative update breaks IKEv2 VPN Connections

KB5009543 or Cumulative update Jan 2022 for Windows 10 and Windows 11 is currently breaking IKEv2 VPN connections. If you are experiencing an unexpected connection failure with a vague error message like “General processing error”, please follow the below steps.

Go to Program and Features -> Installed Updates and uninstall KB5009543. Reboot the box and the VPN connection should start working normally. Optionally you may disable the Windows Update for a period of time so that the same update will not get installed once again. Please note, Microsoft releases updates to their products quite often to resolve issues those were identified. Few times these updates open new issues, like the one happened with this particular KB.

While there are no straight forward methods available to “stop” Windows updates, you can use multiple methods to disable Windows update completely, which we don’t recommend. One of them is using group policies on the local machine.

If you still consider disabling Windows updates temporarily/long term, please refer this excellent tutorial

Hope this helps.

Slow SSH connections from Windows to Linux hosts

Windows built-in firewall does not block SSH connections those are going out & there is no need to create an exception for SSH connections from Windows to LINUX hosts. Still many things could mess up connections.

One of the major culprits being the DNS settings. We had a migration for Primary domain controller from 2008 R2 to Windows Server 2016. Prior the upgrade we brought a temporary VM using VirtualBox to insure that the migration could happen seamlessly. The migration to temporary server happened without issues and we rushed to change the DNS settings for all production servers with the new VM IP address, after removing the IP address for the old PDC from the list.

After the confirmations, we built a fresh VM on VMWare ESXi environment and promoted it as PDC & we ahead with decommissioning the VM built on VirtualBox and forgot that “one thing”. Changing DNS server details for our LINUX servers.

Initially we didn’t give much attention to the SSH connection slowness as these LINUX server(s) running Oracle Applications were known to be slow in responding. However, things didn’t look quite promising as we noticed delays like 40s+ to establish connection to the host while trying to upload files using FileZilla client. It took us almost 8 days to realize that the connection issues were not from the client end, rather from the servers.

Checking the network configurations revealed these servers were still configured with the IP address of the temporary DC at the first entry, that we had for a while. Resetting the DNS entries to existing DNS servers IP addresses resolved the problems instantly.

Side note: No, you cannot overcome this issue by using IP addresses to establish the SSH connection. Regardless, the Linux HOST will try to resolve the client’s IP using the given DNS entries. So the only solution was to correct the DNS entries!

If you ever run into a slow SSH, well, hope know where to look at first after reading this post.

Connecting Oracle Developer 10g to 11G database takes long time

We migrated to 11G R2 (11.2.0.4) for our Oracle Applications R12 few years back, yes few years back (2017) & lived with one of the worst experiences…

Connecting Oracle Developer 10g (Forms/Reports) suite to 11G database.

I have scavenged through community articles for long time before giving up. I hardly came across a single fix for the connection time that used to hang up the Developer suite at times…

Today, I decided to find a solution for the nagging SSH connection issues from Windows 11 to our LINUX application servers and realized that we didn’t update the DNS settings for them once after we decommissioned a domain controller. Once the SSH issues were rectified and addressed, my next attempt was to find a solution for “frmcmp_batch” taking long time to start compiling modules & I landed on the below post.

Credit: Oracle Applications DBA: Form Compilation Against a 11g Database Hangs or Takes a Very Long Time [ID 880660.1] (appsjagan.blogspot.com)

As we are already on 11G R2 11.2.0.4, patching was not required. All I needed was to alter the hidden parameter “_FIX_CONTROL” as mentioned in the article.

SQL> ALTER SYSTEM SET "_FIX_CONTROL"='8560951:ON';

(Use scope=spfile to make this change permanent. This will require you to restart the database.)

I opted to go without spfile for testing & as soon as applied, the “frmcmp_batch” started compiling the modules instantly, against the usual delay that ran into many minutes other times.

Out of curiosity, I tried to connect to the database from Developer 10g & the connection was instant! within a fraction of a second.

So DNS being one of the most important elements establishing successful connections, patches and fixes also play crucial role in providing stable connections. Were you stuck with the same issue? give the solution a try and let us know whether it helped you also.

IIS 7.5+ | Windows Authentication

We decided to retire one of our Windows 2008 (32-Bit) servers, hosting multiple classic ASP intranet applications. Our immediate choice was another VM, that runs Windows 2008 R2, 64-Bit OS with IIS 7.5.x as intermediatory until we setup a brand new VM running Windows 2019 & soon realized that we were in tight spot as any attempt to access intranet application(s) from the new host started prompting for authorization for applications that were using “Windows Authentication”. All our application servers are domain members, so are our clients.

We did an apple to apple comparison between servers/IIS setup, visited dozens of threads & yet were unable to fix the “problem”, that was the site/application asking for authentication for a user who is already authenticated by the Active Directory!

Credits:

Although Midas site article Configuring Web Browsers for Active Directory Integration | MIDAS clearly mentioned about adding the website to local intranet zone, we missed it completely!

After referring third link, had the answer to our problem. Actually, if a client wants to negotiate authentication using “Windows Authentication” through a website by passing currently logged in user credentials, that website should be in Local Intranet zone, which was, for us controlled using a Group policy. This is strictly to make sure that user details are not shared with Internet zones, as a security measure.

Once the new site name was added to the zone list and group policies updated, we were able to access the intranet applications without further issues.

Oracle VirtualBox VM to VMWare ESXi 6+

We had couple of hardware failures, forcing us to build virtual machines using Oracle VirtualBox until we rebuilt the hardware. At organization level we have VMware standardized and according to the plans, initiated migrations from VirtualBox couple of days back.

New machines were created from ESXi 7 host, database backups were restored and applications were online & everything looked fine until we couldn’t get hold of a “chap” who provided us a small MS SQL based application that printed some Governmental forms (Arabic). To insure his “software” wouldn’t be pirated, he had password set to the database user account himself & dictated his own terms.

This forced us to think about alternatives and we decided to build another VM using disks from VirtualBox VM, painfully realizing, it was NOT that easy, however pretty doable.

Credits: Migrate VirtualBox to VMware ESXi 6.5 – VIONBLOG

Few points that I want to add here are:

ESXi creates the machine for EFI boot when much of the VMs you create using VirtualBox are using BIOS for firmware. Hence make sure that you will go to VM Options, Boot Options and select Firmware as “BIOS” before booting the VM after attaching the disks converted from VDI to vmdk following instructions from the above provided link.

Convert the VDI disks to fixed size before converting them to vmdk. This insures marginal performance gains, especially when disks are used for databases.

Use Winscp for large file transfers incase if you are using Windows & uploading disks to ESXi environments. Built-in datastore uploads could error out when file sizes are beyond a particular size. We had 2 vmdk files, exceeding 400GB and the 1st file upload stopped responding after 71%. We managed to upload these files (1 after another) in next 50 minutes using Winscp.

Insure your ESXi datastore has enough free storage because you will be converting the uploaded vmdk disks once again to suite the environment. Another suggestion is, do not convert multiple disks at same time. Going one after another insures that you get the maximum resources to convert files.

Above given link mentions about editing vmdk descriptor to change adapter type. In our case, it was not necessary. Adapter type was set “lsilogi” when we checked those files after last level conversions using vmkfstools. However, you must insure the same.