Converting VirtualBox .VDI .VHD .VMDK to BOOTABLE .iso file - virtualbox

The title is pretty much describe it all.
I thought it would be an extremely easy task but I'm googling the topic for a few days and can not find a proper solution.
I succeed convert it to .iso but it's not BOOTABLE from physical machine.
I have tried :
VBoxManage clonehd file.vdi output.iso --format RAW
I have tried :
VBoxManage clonemedium --format RAW gangina.vdi gangina.img
I have tried :
qemu-img convert -f vpc -O raw gangina.vhd gangina.raw
I have also tried to mount the bootable vdi file and :
sudo dd if={mountedDirectory} of=gangina.iso status=progress
unfortunately none of them is actually bootable from physical machine.
I'm sad :(

You cannot DD with a mounted directory.
You can dd the partition, but it would work better to dd the entire drive
example: dd sudo dd if={/dev/sda} of=filename.iso status=progress
i am assuming you are on a linux machine, but when you get it write to a usb and plug it in and boot it. i have used this method before with much success!
while you can do just a partition say sda1 or sda2 dd'ing the entire drive will achieve what you are looking for.
Keep on Keeping on

You can convert your bootable .VDI .VHD and .VMDK souce to BOOTABLE .iso on follow way on Linux like p.e. Ubuntu, Mint or Debian:
Convert .vdi to .img
qemu-img convert -f vdi -O raw source_image.vdi destination_image.img
Convert .vhd to .img
qemu-img convert -f vpc -O raw source_image.vhd destination_image.img
Convert
qemu-img convert -f vmdk -O raw source_image.vmdk destination_image.img

Related

Can't boot VDI image after converting qcow2 QEMU image [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I try to launch a VirtualBox VDI image (obtained from a qcow2 image created with QEMU). This image has been created with the following command, starting from
qemu-img convert -f qcow2 -O vdi debian-9.0-sparc64.qcow2 debian-9.0-sparc64.vdi
Version of qemu-img is :
$ qemu-img --version
qemu-img version 2.9.0
But when I add the VDI image into VirtualBox, illustrated as below :
and launch it, I get this message :
From what I have seen on similar FATAL errors, It seems that I have to add an ISO image of the OS, in addition to the VDI image created, doesn't it ?
I have an ISO image of Debian-9 Sparc64 (debian-9.0-sparc64-NETINST-1.iso) but this is an installation raw ISO image, not a current ISO image with an installed OS.
I tried to add this ISO image in configuration panel like this :
and the ordering of boot devices :
I have also tried to generate a VDI image from this tutorial,
but without success.
For the moment, I can only launch the qcow2 image with QEMU like :
qemu-system-sparc64 -name debian-sparc64 -machine sun4u,accel=tcg,usb=off -m 1024 \
-realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 \
-rtc base=utc -no-reboot -no-shutdown \
-boot strict=on \
-drive file=debian-9.0-sparc64.qcow2,if=none,id=drive-ide0-0-1,format=qcow2,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-1,id=ide0-0-1 \
-netdev user,id=hostnet0,hostfwd=tcp::5555-:22 \
-device e1000,netdev=hostnet0,id=net0,mac=52:54:00:ce:98:e8 \
-msg timestamp=on -nographic
I was motivated to launch Debian 9 Sparc64 with VirtualBox because, with qemu-system-sparc64, I can't have network (but this is a different problem).
What might be wrong (to launch VirtualBox VDI image) or give some clues to fix this error message at boot ?
Update 1
The issue seems to come from the conversion between .qcow2 and VDI with qemu-img tool. How to make bootable a VDI disk ?
VBoxManage convertdd debian-9.0-sparc64.qcow2 linux_file.vdi

Failed to open disk file image Result Code: VBOX_E_IPRT_ERROR (...) Callee RC: VBOX_E_OBJECT_NOT_FOUND (...)

Because of some internal errors, the vdi file got corrupted, because of which, the header of the vdi file has become invalid.
Virtual box is not allowing to attach VDI even to another newly created machine.
I am getting following error :-
failed to open disk file image Result Code: VBOX_E_IPRT_ERROR (0x80BB0005) Component: MediumWrap Interface: IMedium
{4afe423b-43e0-e9d0-82e8-ceb307940dda} Callee: IVirtualBox
{0169423f-46b4-cde9-91af-1e9d5b6cd945} Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
Here is a simple solution for this problem to try if you have not already tried this:-
If you are using Windows 10 and if you are fine with losing some of your recent data then a simple 'First Aid' solution for this is :-
Go to your virtual box vdi file, right click on it and select 'Restore to previous version'. Again attach that vdi and you are done!
You can repair the header with this command:
VBoxManage internalcommands repairhd -format VDI yourfile.vdi
answering the above about posting the command VBoxManage internalcommands repairhd -format VDI yourfile.vdi
I figured out that my shell/cmd wont recognize that as a command either. you need to put ./ before vbox manage. so it looks like "./VBoxManage internalcommands repairhd -format VDI yourfile.vdi" without the quotes. i cant attest to that command working as i havent tried it yet, im about to. I just know that for some reason I have to add ./ before vboxmanage commands for them to work.

OSDev: Windows 7 'copy' command won't copy to b:\ from ImDisk

I have a .bat (Batch) file compiling an OS I am making in Windows 7. I use nasm to compile the code, then dd and imdisk. Although probably not worth mentioning, after compilation I use mkisofs to make a .iso then VirtualBox for testing.
When it gets past "Copying kernel and files to disk" it (the output in the prompt) says The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. 0 file(s) copied.
It compiled before in which I could properly test the OS and some text would appear, then I noticed nothing appeared on the screen anymore, so I further looked at the prompt output and batch file and realized this.
Can anyone give me some help here? I really want it to compile.
Here is the main part that errors in my batch file:
echo Adding boot to disk
cd build
dd if=..\src\boot\boot.bin bs=512 of=myos.flp
cd ..
echo Mounting disk image
imdisk -a -f build\myos.flp -s 1440K -m B:
echo Copying kernel and files to disk
copy src\kernel.bin b:\
echo Dismounting disk image
imdisk -D -m B:
I am able to successfully compile MikeOS (my inspiration) with pretty much the same commands (I modified the MikeOS buildwin.bat to use dd), so I have no idea what is happening.
EDIT: I even tried this in Ubuntu with dd and it doesn't work! When I get to the mount part it says something about the filesystem...I think my dd command is wrong, but for some reason I can compile MikeOS correctly. Ugh.
The boot file should always be in the first sector. Try this:
dd seek=0 if=..\src\boot\boot.bin bs=512 of=myos.flp
seek=0 copies the boot file to the first sector. If you don't put it, the dd command may copy the file to somewhere else.

youtube-dl command saves as flv and not mp3

So below is my command that I am running. It should be converting it to mp3 but it still exports as a video in flv. What am I doing wrong?
$cmd = '/usr/local/bin/youtube-dl -o "%(title)s.%(ext)s" -x --audio-format mp3 -- '.escapeshellarg($url).'';
youtube-dl will download the video before converting it. Most likely, you don't have ffprobe or ffmpeg installed. Make sure both programs are available (i.e. you get a sensible output for ffprobe --help and ffmpeg --help).
You can directly download the .mp3 file from the youtube site.
For e.g in ubuntu terminal youtube-dl youtube.com/watch?v=qn6CMz18lkQ -f 141 .Most probably 141 is the .mp3 file format code for better quality.

VMWARE ESXi PANIC: Failed to find HD boot partition

I've got problems installating the VMWARE ESXi Server.
The Installation finishes without any error messages and prompts me to reboot.
After pressing Enter the System reboots. While booting through the yellow loading-screen it switches to black and displays the following Error-Message:
PANIC: Failed to find HD boot partition
All modules have been loaded without any errors.
After typing unsupported into the console the busybox comes up.
I tooked a look into the /dev/disks directory but no disk devices gets listed in difference to the installation process.
Switching to the system-console during installation both sata disks on MPC51 controller are shown.
The controllers are named vmhba0 and vmhba32.
Does anyone know how to solve the problem?!
Hardware is a ESPRIMO P5615 (nForce4) from Fujitsu-Siemens.
The only solution I have found is to run the server from a thumb drive and use the embedded hard drive to store your virtual servers. This solution worked for me.
To achieve this in this way you will need:
A USB thumb drive 1GB or larger
An active Linux machine (or, use a liveCD option on your PowerEdge such as Knoppix or Gentoo LiveCD)
Mount your ESXi ISO:
mount -t iso9660 -o loop VMware-VMvisor-InstallerCD-3.5.0_Update_2-110271.i386.iso /mnt/esx
Write the installer file to the thumb drive:
tar xvzf /mnt/esx/install.tgz usr/lib/vmware/installer/VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd.bz2 -O | bzip2 -d -c | dd of=/dev/sdb
Assumptions here (adjust to your settings):
/dev/sdb is where your thumb drive resides
VMware-VMvisor-InstallerCD-3.5.0_Update_2-110271.i386.iso is the name of your ISO file
usr/lib/vmware/installer/VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd.bz2 is the name of the dd file in your iso (run tar ztf /mnt/esx/install.tgz to see what your exact file name is, it should be similar and relatively obvious)
It will take a few minutes to write, and when it's done simply boot off of this thumb drive. The PowerEdge servers have an internal USB (at least mine does) if aesthetics are important to you.
Source: http://cyborgworkshop.org/2008/08/30/install-vmware-esxi-onto-a-usb-thumbdrive/
EDIT 12/19/2009: ESXi 4.0.0 uses image.tgz instead of install.tgz to store it's dd file