This is a nice tutorial which source is here. I do not guarantee it works, you should have backup first.

If you have Linux server with SSH only access, no KVM/IP, no IPMI and need to install new OS from .iso image to your server (even MS WIndows), try this:

1) have Ubuntu installed (maybe other OS will work too)
2) login SSH and run: sudo -i
3) format the server HDD: dd if=/dev/zero of=/dev/sda bs=1M count=1
4) create new RAM based mount point with the size slightly more than your .iso image: mount -t tmpfs -o size=8000m tmpfs /mnt
5) download the .iso: wget -P /mnt "http://link.to/your/image.iso"
6) install portable qemu: wget -qO- /tmp https://ia601503.us.archive.org/12/items/vkvm.tar/vkvm.tar.gz | tar xvz -C /tmp
7) start qemu:
Code:
/tmp/qemu-system-x86_64 -net nic -net user,hostfwd=tcp::3389-:3389 -m  2048M -localtime -enable-kvm -cpu host,+nx -M pc -smp 2 -vga std  -usbdevice tablet -k en-us -cdrom /mnt/NAMEOFYOUR.ISO -hda /dev/sda -boot once=d -vnc :1
8) install VNC viewer: https://realvnc.com/download/viewer/ and use it to connect your server IP and port 1 (1.2.3.4:1)
9) in case of Windows, disable Firewall and enable RDP from within System properties.
10) in case of Windows, is important to put following into C:\ boot
Code:
/tmp/qemu-system-x86_64 -net nic -net user,hostfwd=tcp::3389-:3389 -m 2048M -localtime -enable-kvm -cpu host,+nx -M pc -smp 2 -vga std -usbdevice tablet -k en-us -hda /dev/sda -boot c -vnc :1
11) if you installed Windows, connect it via RDP or restart Windows if not work.