In this tutorial, you will learn how to convert from UEFI to BIOS to avoid operational problems on the Jotelulu platform.
Machines using UEFI technology are not supported by Jotelulu, particularly Azure Gen2 and Hyper-V Gen2 virtual machines.
As a result, you may receive the following message or something similar when trying to booth one of these machines:
iPXE: (hrrp://ipxe.org) 00:04.0 CA00 PCI2.10 PMM-0010000100011020 CA00
Press F12 for boot menu.
Boot device: Hard Disk – success.
Boot device: CD-Rom – Failure: could not read boot disk
No bootable device.
Powering off in 30 seconds.
NOTE: In Part 5 of this tutorial, you will find a step-by-step procedure to resolve corrupted boot problems on a Microsoft Windows server.
How to convert from UEFI to BIOS
Before you get started
To successfully complete this tutorial and convert from UEFI to BIOS, you will need:
- To be registered with an organisation on the Joteluu platform and have logged in.
- To have registered for a Servers subscription.
- To have a migrated Windows server with boot problems linked to your subscription.
- To have an operational Ubuntu20 server linked with your subscription.
NOTE: Before proceeding with this tutorial, we recommend backing up your server so that it can be recovered if you should make a mistake. We won’t want you to accidentally end up deleting all your data.
NOTE: Furthermore, once you have finished this procedure, we recommend deleting any unneeded backups. Even though you are not charged for backups, you will be charged for the storage space that you use and backups can take up a lot of space.
Preparing your Ubuntu machine
If you don’t have an Ubuntu20 machine linked to your Servers subscription, you will need to deploy one in order to recover the server that you are having problems with.
You will also need to configure the server so that you can connect to it using an SSH connection and use the command prompt. In addition, you will need to open the SSH port on the firewall of your Servers subscription and use a connection program, such as PuTTY, if you are connecting from a Microsoft Windows device.
Part 1 – Preparing your servers
The first thing you will need to do is stop the virtual machine that is currently not booting correctly. To do this, on the Jotelulu platform, open the Servers subscription that the server is linked to and click on the server in question.
On the next screen, click on “Stop” at the top of the screen (1).
Part 1 – Stop the server that is not booting correctly
Once the server has stopped, click on “Disks” in the left-hand menu (2) of the Servers page. Look for the disk that belongs to the server, click on the three dots on the right (3) andselect “Disconnect” (4).
Part 1 – Disconnect the disk that you wish to change
The disk has now been disconnected from the original server. Next, we are going to connect it to the Ubuntu20 server and use this to carry out the boot repair procedure.
To connect the disk to the Ubuntu server, click on “Disks” on the left-hand side of the Servers page (5). Look for the disk that you have just disconnected, click on the three dots on the right (6) and select “Connect” (7).
Part 1 – Connect the disk to the Ubuntu server
You will then be asked to select a server (8) to connect the disk to. Select the Ubuntu server and click on “Continue” (9).
Part 1 – Select the server to connect the disk to
Once the disk is connected to the server, return to the Servers page, select the server and click on start (10).
Part 1 – Boot the Ubuntu server
At this point, we need to add an inbound firewall rule for the server so that we can connect remotely via SSH for greater convenience.
To do this, go to the Servers page, open the Ubuntu server settings and at the bottom of the screen, in the “Firewall – Inbound Rules” section, click on “New rule” (11).
Part 1 – Create a new inbound rule to connect using SSH
On the next screen, you will need to enter the following details:
- Select network: (21) Select the network that you wish to use to establish the connection. The default option will generally be the correct one.
- IP or Network: (22) The IP or network from which the connection will be made. By default, this is set to “Any IP Address”, but we recommend limiting this by entering the IP address or range of IP addresses that you wish to allow. This is especially the case if you are not expecting any attempted connections from any other location.
- Protocol and public port: (23) The port that you want to use to connect. This is composed of the protocol (TCP or UDP), in this case, TCP, and the port number, which in this case is port 22.
- Public IP: (24) The public IP address of the server that will connect.
- Private (IP): (25) The private IP address of the server that will connect.
- Private port: (26) The port that we want to use to connect, in this case just the port number (Port 22).
Once you have entered these details, click on “Continue” (18) to create the rule.
Part 1 – Create a rule to allow SSH connections
You will now be able to connect to the GNU/Linux Server console using SSH through the use of a connection program like PuTTY, which is one of the most commonly used programs to connect via SSH (and other protocols) from Windows devices.
NOTE: You can download PuTTY here.
Part 1 – Use PuTTy to connect to the server via SSH
Part 2 – Changing the disk
The next step is to connect to the server via SSH, using a tool such as PuTTY, for example.
Once connected, you will need to list the available disks on the server and identify the one which you wish to repair.. To do this, use the “fdisk –l”command (19) which will show all the disks and partitions on the machine.
The output of this command (20) will tend to look something like this:
/etc/xvda1
/etc/xvda2
/etc/xvda3
/etc/xvdb1
/etc/xvdb2
/etc/xvdb3
/etc/xvdb4
/etc/xvdb5
Here, you can see that all of them begin with “/etc/”. This is because the settings file for these devices and partitions is linked to the mounted disk.
You can also see that the string that follows starts with “xvd”.
Lastly, you will see an “a” or a “b” followed by a number. This is because each system disk has an assigned letter, in alphabetical order. Then, each partition is assigned a number, starting with “1”.
Therefore, we can see that there are two disks shown. Disk “a” has three partitions (“/etc/xvda1”, “/etc/xvda2” and “/etc/xvda3”) and disk “b” has five (“/etc/xvdb1”, “/etc/xvdb2”, “/etc/xvdb3”, “/etc/xvdb4” and “/etc/xvdb5”).
For this tutorial, we are interested in disk “b” since disk “a” executes the Ubuntu operating system and disk “b” is the disk mounted for repair. However, this will vary depending on how many disks you have mounted on your server.
Part 2 – Check the disks connected on the server and identify the one you wish to work on
Next, you need to edit the disk that you wish to change (in this tutorial, “/etc/xvdb”). To do this, run the command “gdisk /dev/xvdb” (21).
You will then see information about the partition table, telling you what type it is. Here, you should see a line which says “GPT: Present” (22). This indicates that this is a GPT-type disk with no current issues.
If you see “GPT: Damaged”, you will need to perform an additional step that we will explain in Part 3. If this happens, skip to Part 3 and return to this point once you have completed those instructions.
Part 2 – Run the gdisk command and check the partition table
If you see the line “GPT: present”, type the following commands (23) in the order shown below:
r: Recovery and transformation options.
g: Convert the GPT partition to MBR.
s: Prepare the MBR partition.
p: Show the MBR table.
w: Write table to disk.
y: Validate write and exit the program.
Part 2 – Run gdisk commands to change the disk
You have now finished this part of the process and you should move on to Part 4.
Part 3 – Procedure to follow if you receive the message “GPT: Damaged”
IMPORTANT: You should only follow the instructions in this section if you have received the message “GPT: Damaged”.
NOTE: It is always good practice to back up any disk that you are working on before performing this procedure.
If you ran the command “gdisk /dev/xvdb” and received the error message “GPT: Damaged”, you will need to perform an additional step to convert your disk to BIOS.
After running the “gdisk” command, enter the following commands in the order (24) listed here:
p: Print the partition table information.
w: Write the partition table and exit.
y: Confirm writing of the partition table.
Part 3 – Use the following gdisk commands to recover the GPT partition
Then, run the command “gdisk /dev/xvdb” once more (25) and check that you now receive the message “GPT: present”.
Part 3 – Use the gdisk command to check that the GPT partition is present and not damaged
At this point, you can now return to Part 2 and pick up where you left off.
Part 4 – Windows Startup Repair
So far, you will have converted the disk, but it is not connected to your Windows server. Therefore, we need to stop the server, disconnect the disk from the Ubuntu machine and connect it to your Windows server.
NOTE: We have already explained how to disconnect and connect the disk to different servers in Part 1, so we will not repeat these instructions here.
Once you have reconnected your disk to your Windows server, you will need to load an ISO image so that you can start it, much like if you were working on a physical machine and needed to perform a maintenance or recovery task.
To do this, on the Jotelulu platform, open the Servers section, select the server, and in the top-right of the screen, you will see “No ISO” (26). Click on the drop-down menu and select the ISO (27) corresponding to your server’s operating system (e.g., Windows Server 2019).
Part 4 – Select the ISO to mount on the server in order to launch recovery options
Once you have done this, you should start the server. Click on “Start” (28) and confirm that you wish to start the server.
Part4 – Start the server
Once the server is running, click on CMD (29).
NOTE: It’s quite likely that you will not be able to connect at the first attempt as the system may still be booting. Relaunch as many times as you need until the ISO loads correctly.
Part 4 – Launch CMD from the platform
Once the CMD has loaded, you will need to boot from CD/DVD, in other words, from the ISO that you just selected. You will have to wait for the message “Press any key to boot from CD or DVD…” and press “Enter” (30) so that it boots from the image and starts loading the system files.
Part 4 – Press Enter to load the ISO connected to the machine
NOTE: It is quite common for the machine to not respond the first time you press Enter. As a result, you may see the operating system loading as normal. If this happens, simply restart or turn off the machine and try again.
If everything has been done correctly, the machine will start to load ISO and decompress the binaries. You will need to be patient while it loads.
Part 4 – Wait for the ISO to boot
Once the “Windows Setup” loads, simply click on “Next” (31). The language settings are not too important as we are now going to work using the command prompt.
Part 4 – Click on Next
On the next screen, click on “Repair your computer” (32) to load the system recovery options.
Part 4 – Click on Repair your computer
Next, select “Troubleshoot” (33).
Part 4 – Select troubleshoot
From the advanced options, select “Command prompt” (34).
Part 4 – Select Command Prompt
In the command prompt window, you will now need to run a series of commands (35), which are the same as when you are creating a bootable USB disk.
The commands to run are the following:
diskpart
list disk
select disk <boot_disk>
list partition
list volume (this will serve to identify the volume where Windows is being installed)
Where:
- “<boot_disk>” will be the disk that you wish to use to boot the system. It is not possible to choose a data disk.
Review the information until you find the “C:” partition. Then, run the following commands using the corresponding partition number (36).
select partition <boot partition>
active
exit
If you have performed everything correctly, when you run the “activate” command, you should receive the message “Diskpart marked the current partition as active” (37).
Part 4 – Run diskpart and mark the partition as active
You now need to make the partition bootable. To do this, search for the letter that contains the Windows operating system. This may be “D:” since “C:” is used by the recovery system. You will also need to identify the drive letter where the ISO has been loaded, which will be equivalent to CD/DVD. “E:” or “F:” are the most common options.
Once you have identified the correct drive letters, run the following commands (38):
F:
dir
BCDBOOT D:\Windows
bootrec /fixmbr
Where:
- F: The drive where the ISO is mapped (the CD/DVD).
- D: The drive containing the Windows operating system.
After running “bootrec /fixmbr”, if everything goes well, you should see the message “Operation completed successfully”.
You are now able to restart the machine and check that it boots without any problems.
If, on the other hand, you run the command “BCDBOOT D:\Windows” and receive the message “Failure when attempting to copy boot files”, this will mean that the command has failed. If this happens, continue to Part 5 of this tutorial.
Part 4 – Complete Windows boot recovery
Part 5 – What to do if you encounter an error when copying boot files
NOTE: You should only follow these instructions if you run “BCDBOOT D:\Windows” and receive the message “Failure when attempting to copy boot files”.
To resolve this issue, simply follow the procedure below in order without skipping any steps.
First, run “diskpart” (39) to identify the disk and partition containing the Windows operating system:
diskpart
list disk
Then, run the following command (40):
select disk 0
You should then see a list of partitions. Find the one that has Windows installed and mark it as active (41):
list partition
select partition 3
active
exit
Part 5 – Run the first part of the boot recovery
Finally, you need to run the recovery commands (42) from the ISO (CD/DVD) drive:
dir
BCDBOOT D:\Windows
bootrec /fixmbr
Where:
- F: The drive where the ISO (CD/DVD) is mapped.
- D: The drive containing the Windows operating system.
Part 5 – Run the second part of the boot recovery
You have now completed the boot recovery.
Conclusions
In this tutorial, you have learnt how to convert from UEFI to BIOS on your Windows server. This will allow you to run a Microsoft Azure or Microsoft Hyper-V machine on the Jotelulu infrastructure.
We have also covered the procedures to follow to repair boot corruption issues on a Windows machine.
Whilst these procedures are a little more complex than other tutorials, this tutorial should clearly explain how to perform these tasks without any serious issues.
We hope that you have found this tutorial useful. However, if you do have any problems or questions, please don’t hesitate to contact us so that we can help you.
Thank you for choosing Jotelulu!