ViTALiTY Posted October 10, 2014 Share Posted October 10, 2014 Can anyone do this easily? I have a Debian image configured and installed for some stuff I desperately need, but I need it in ISO, not a VMWare image. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Mr-Protocol Posted October 10, 2014 Share Posted October 10, 2014 This should help: https://wiki.debian.org/DebianCustomCD Quote Link to comment Share on other sites More sharing options...
ViTALiTY Posted October 10, 2014 Author Share Posted October 10, 2014 This should help: https://wiki.debian.org/DebianCustomCD Yea, but the thing is that the image is configured in such way that I can't do it, as I do not have the knowledge to do so. So the best way is really to convert the image to an ISO. I just need it as a LiveCD, nothing else. Quote Link to comment Share on other sites More sharing options...
Mr-Protocol Posted October 10, 2014 Share Posted October 10, 2014 I'm not sure you can just take an installed system and roll it back to an ISO. If you have a thumb drive large enough, you can image it to your thumb drive and boot off of it. Quote Link to comment Share on other sites More sharing options...
ViTALiTY Posted October 10, 2014 Author Share Posted October 10, 2014 If you have a thumb drive large enough, you can image it to your thumb drive and boot off of it. That would be awesome. And how would I do that? Quote Link to comment Share on other sites More sharing options...
Mr-Protocol Posted October 10, 2014 Share Posted October 10, 2014 I'm not sure if it would work 100%, but you can always just install your OS to USB, then image it off as a backup. I would use Linux and the dd command, just be careful or you can destroy your data lol. You may be able to use tools like clonezilla as well. I'm sure there are a number of software options out there. Quote Link to comment Share on other sites More sharing options...
cooper Posted October 10, 2014 Share Posted October 10, 2014 Isn't there a slight danger here in that your hardware may not be properly supported from this image since it's now configured to work with the virtual/emulated hardware exposed within the VM? As a starting point, I'd suggest going the 'cp -a' route. Using fdisk create a sufficiently large partition on a USB stick but don't mark it as bootable just yet. Find out what the UUID of the USB stick's partition is by running ls -al /dev/disk/by-uuid You're going to need that uuid exactly as presented there a few times... Mount the stick from within the virtual, let's assume you have /mnt/stick for that, and then, from the root directory: cp -a /bin /mnt/stick cp -a /boot /mnt/stick etc. etc. cp -a /var /mnt/stick As you do this, exclude the dev, proc and sys folders. Just create these directories in /mnt/stick when you're done. Remove /mnt/stick/etc/mtab as that file keeps track of the currently mounted filesystems and the OS now on your stick hasn't mounted anything. Having done this, restart the virtual with the stick in it. If you're using lilo then at the boot prompt select the normal image you'd use and type, after the name, root=UUID=<the uuid of the stick's partition> If you're using grub, select the option you'd normally use and, from that menu, select edit and append that bit to the kernel parameters. End result is that you should now be running your VMWare's Linux kernel but using of the stick for disk. Once booted up, it's a good idea to verify this by running 'mount' and making sure '/' is mounted as the device with that UUID. If it's the case, update your /etc/fstab and your grub/lilo config file(s) such that it now points at the USB stick. In all cases where a device name is needed and you want to specify the stick, write simply "UUID=<the uuid of the stick's partition>". You can't use /dev/sdX9 since in that the X and the 9 will be different from one machine to the next whereas the uuid will remain constant. Finally, run fdisk on your stick again and mark the stick's partition as bootable. From this point on your stick should contain a live copy of your OS, capable of being booted on any machine, assuming that the kernel on there supports all the hardware present on the box. Quote Link to comment Share on other sites More sharing options...
ViTALiTY Posted October 10, 2014 Author Share Posted October 10, 2014 Isn't there a slight danger here in that your hardware may not be properly supported from this image since it's now configured to work with the virtual/emulated hardware exposed within the VM? As a starting point, I'd suggest going the 'cp -a' route. Using fdisk create a sufficiently large partition on a USB stick but don't mark it as bootable just yet. Find out what the UUID of the USB stick's partition is by running ls -al /dev/disk/by-uuid You're going to need that uuid exactly as presented there a few times... Mount the stick from within the virtual, let's assume you have /mnt/stick for that, and then, from the root directory: cp -a /bin /mnt/stick cp -a /boot /mnt/stick etc. etc. cp -a /var /mnt/stick As you do this, exclude the dev, proc and sys folders. Just create these directories in /mnt/stick when you're done. Remove /mnt/stick/etc/mtab as that file keeps track of the currently mounted filesystems and the OS now on your stick hasn't mounted anything. Having done this, restart the virtual with the stick in it. If you're using lilo then at the boot prompt select the normal image you'd use and type, after the name, root=UUID=<the uuid of the stick's partition> If you're using grub, select the option you'd normally use and, from that menu, select edit and append that bit to the kernel parameters. End result is that you should now be running your VMWare's Linux kernel but using of the stick for disk. Once booted up, it's a good idea to verify this by running 'mount' and making sure '/' is mounted as the device with that UUID. If it's the case, update your /etc/fstab and your grub/lilo config file(s) such that it now points at the USB stick. In all cases where a device name is needed and you want to specify the stick, write simply "UUID=<the uuid of the stick's partition>". You can't use /dev/sdX9 since in that the X and the 9 will be different from one machine to the next whereas the uuid will remain constant. Finally, run fdisk on your stick again and mark the stick's partition as bootable. From this point on your stick should contain a live copy of your OS, capable of being booted on any machine, assuming that the kernel on there supports all the hardware present on the box. Thanks for the help, but I guess that is way too much for me. Quote Link to comment Share on other sites More sharing options...
cooper Posted October 10, 2014 Share Posted October 10, 2014 Quote Link to comment Share on other sites More sharing options...
ViTALiTY Posted October 10, 2014 Author Share Posted October 10, 2014 (edited) Ok so, I got around to trying this:http://www.turnkeylinux.org/blog/convert-vm-iso And I'm stuck in this: mount -o loop turnkey-core.raw turnkey-core.mount Error: "mount: you must specify the filesystem type" So maybe the VM has partitions. Then I did these two: loopdev=$(losetup -s -f turnkey-core.raw)apt-get install kpartxAnd I got stuck here:kpartx -a $loopdev Error: llseek errordevice-mapper: resume ioctl on loop0p1 failed: Invalid argumentcreate/reload failed on loop0p1device-mapper: resume ioctl on loop0p2 failed: Invalid argumentcreate/reload failed on loop0p2 And I have absolutely no idea on what to do now. Edited October 10, 2014 by ViTALiTY Quote Link to comment Share on other sites More sharing options...
cooper Posted October 10, 2014 Share Posted October 10, 2014 Okay. So clearly, as you suspected, your VMWare image has 2 partitions and losetup is used to create a loopback device for each of them by mapping into the turnkey-core.raw file. Roughly how large is your turnkey-core.raw file? I'd say try again, this time starting with the command losetup -D to remove any previously created loopback mappings, and you can leave out the apt-get command since the program has already been installed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.