OVHcloud Community

Welcome to your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Installing Operating System from custom image on OVH VPS ( CentOS 8 Tutorial)


In theory this should work with any custom ISO, however I tested only with CentOS 8

1) Reboot VPS in rescue mode

2) Connect to Rescue Mode via SSH, unmount /dev/sdb1 and remove all partitions:

# lsblk
# umount /dev/sdb1
# fdisk -u /dev/sdb
> d
> d 
> w

3) Install required packages:

# apt install qemu-kvm

4) Download your ISO - usually Rescue Mode has very little space so you may want to download NetInst/Minimal ISO:

# wget

5) Run qemu (replace ISO location and vdisk name if required):

# qemu-system-x86_64 -netdev type=user,id=mynet0 -device virtio-net-pci,netdev=mynet0 -m 2048 -localtime -enable-kvm -drive index=0,media=disk,if=virtio,file=/dev/sdb -vga qxl -spice port=5900,addr=,disable-ticketing -daemonize -cdrom /tmp/CentOS-8-x86_64-1905-boot.iso -boot d

6) Assuming your workstation is running Linux, forward a port through an SSH tunnel to your VPS:

# ssh -4 -v root@<your_vps_ip> -L 5900:localhost:5900

7) On your localhost, connect to SPICE running on local port 5900:

# remote-viewer
> spice://

8) Perform installation as usual.

Note: Since you downloaded Minimal/NetInst image, you need to configure source installation.
For CentOS 8 I used:

a) http
b) repository URL

9) Reboot server and exit Rescue Mode.

10) Connect to your new instance running CentOS 8:

# cat /etc/redhat-release 
CentOS Linux release 8.0.1905 (Core)

No FreeBSD option while reinstalling VPS

Thanks for the great tutorial guide.

Is there any limit to the size of the rescue area?

I would like to mount a Windows XP or 7 ISO, do you have tutorial guide for that?

Thank you very much.


If there isn’t room on the rescue disk for a larger ISO, you could copy it to a RAM disk…

mkdir /mnt/ramdisk
mount -t tmpfs -o rw,size=2G tmpfs /mnt/ramdisk


okay so i can get this to boot with a little fiddling but wqhen i get to pick disk in windows installer no disks appear any idea why


HI @BenD

It happens because you have to load the virtio drivers for Microsoft Windows to find the corresponding signatures to identify virtual machine disks on Linux.

You can download it from here

Although you don’t need to create a Virtual Machine to install custom ISOs or Microsoft Windows. This can be done from IPMI (Java KVM Console) provided by OVH / Soyoustart

You can also do it through rescue mode with a little more advanced experience

At least, with the IPMI / KVM Console you can mount a remote hard disk and perform the installations directly on the machine without virtualizing

I hope I have clarified or helped

Carlos Frias (SysAdmin)


Hi @sysdop
I’m training to install Rocky Linux 8.4 RC1 using your approach.
Boot iso image is too largem then I’m using an 800MB ramdisk.
This is my command:
qemu-system-x86_64 -netdev type=user,id=mynet0 -device virtio-net-pci,netdev=mynet0 -m 1024 -enable-kvm -drive index=0,media=disk,if=virtio,file=/dev/sdb,format=raw -vga qxl -spice port=5900,addr=,disable-ticketing -daemonize -cdrom /mnt/ramdisk/Rocky-8.4-x86_64-boot.iso -boot d
The virtual machine seems to boot smoothly, but when anaconda is starting, qemu crash without particular message. Find atteched the log file.

main_channel_link: add main channel client
main_channel_client_handle_pong: net test: latency 34.538000 ms, bitrate 11607542 bps (11.069815 Mbps)
inputs_connect: inputs channel client create

What’s happening?
Thanks so much.



You can put the ISO-image on another host and mount it with NFS.
Just tested it, and it works fine.



I have a vps on ovh and when following your steps, I have an error.

$ qemu-system-x86_64 -netdev type=user,id=mynet0 -device virtio-net-pci,netdev=mynet0 -m 2048 -localtime -enable-kvm -drive index=0,media=disk,if=virtio,file=/dev/sdb -vga qxl -spice port=5900,addr=,disable-ticketing -daemonize -cdrom /dev/debian-
11.3.0-amd64-netinst.iso -boot d

qemu-system-x86_64: -localtime: invalid option

I tried to remove the -localtime parameter and then I have a second error :

[RESCUE] root@vps-dbxxxxxx:/dev $ qemu-system-x86_64 -netdev type=user,id=mynet0 -device virtio-net-pci,netdev=mynet0 -m 2048 -enable-kvm -drive index=0,media=disk,if=virtio,file=/dev/sdb -vga qxl -spice port=5901,addr=,disable-ticketing -daemonize -cdrom /dev/debian-11.3.0-amd6
4-netinst.iso -boot d

(process:2054): Spice-WARNING **: 18:17:58.139: reds.c:2645:reds_init_socket: binding socket to failed
qemu-system-x86_64: failed to initialize spice server

Any idea ?

Best Regards,