Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


KVM: Install any OS if the host doesn't allow custom ISOs or you need more RAM for the installer
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

KVM: Install any OS if the host doesn't allow custom ISOs or you need more RAM for the installer

dmmcintyre3dmmcintyre3 Member
edited May 2012 in General

Generating the disk image:

Create a KVM VPS on with the same amount or less disk space than the KVM VPS you plan on uploading it to. Be sure to use a disk image, not a LVM for the VPS's storage. Install the OS in the VPS, then shut down the VPS. Find the disk image, compress it with gzip, and move it somewhere web accessible. I chose to upload the disk image to another VPS.

If you want to move the contents of a physical drive to a VPS, unmount all partitions on the drive, then:
dd if=/dev/sdb of=diskimage.raw
Note: you'll need a drive smaller than the KVM VPS you plan on uploading the disk image to. Move the newly created disk image somewhere web accessible and compress it with gzip.

On the VPS:
Boot a live CD on the VPS or any ISO that you can get to the shell, configure networking and use wget, gunzip and dd.
Run this command:
wget http://disk.image/location.gz -O -|gunzip|dd of=/dev/sda
This may take a while and/or appear to stop during the transfer.
After it finishes, reboot the VPS.

Comments

  • AsadAsad Member

    Pretty useful if it works. Cheers for sharing.

  • AldryicAldryic Member

    Nice work. However, some providers do limit what templates they make available for a reason.. I strongly suggest checking with your host before using this trick to upload an ISO that they do not offer.

    My reason for mentioning this is there are a handful of ISOs out there that are pretty much designed specifically for skids. And using this trick to load anything of that nature over at BuyVM will only result in termination. I'm sure other providers don't want such tools run on their networks, either.

  • miTgiBmiTgiB Member

    @Aldryic said: before using this trick to upload an ISO that they do not offer.

    I bet you are just saying things and meaning another, but he is not uploading an ISO, he's uploading a filesystem

  • FranciscoFrancisco Top Host, Host Rep, Veteran
    Expand: I bet you are just saying things and meaning another, but he is not uploading an ISO, he's uploading a filesystem

    True what he means is that people may try to use this to load malicious things :)

    It's a very clever method though, well done dmm3.

    Francisco

  • AldryicAldryic Member
    edited May 2012

    @miTgiB said: I bet you are just saying things and meaning another,

    Correct sir, having trouble with do switching back to EN tonight.

  • netomxnetomx Moderator, Veteran

    @dmmcintyre3 said: After it finishes, reboot the VPS.

    Wow, excellent approach. Kudos for ya!

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    @dmmcintyre3 - So how do you handle the space that's not assigned? you just gparted/fdisk it?

    Anthony actually made an openvz like template for all of our nodes so he can roll out physical nodes in minutes of me putting the KVM on it, it's pretty awesome. We're likely going to use his code to do KVM templates at some point.

    Francisco

  • @Francisco said: So how do you handle the space that's not assigned? you just gparted/fdisk it?

    Ideally you'd make the disk image be the size of the disk you'll be restoring to or just slightly smaller. But, gparted/fdisk should be able to resize it to the full size of the disk if you made it too small.

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    @dmmcintyre3 said: Ideally you'd make the disk image be the size of the disk you'll be restoring to or just slightly smaller. But, gparted/fdisk should be able to resize it to the full size of the disk if you made it too small.

    Ah makes sense figured you had some clever way or there was a script not included :)

    Francisco

  • cedriccedric Member

    @Aldryic / @Francisco: Couldn't they just instal their 'tools' without needing to restore a disk image?

  • FranciscoFrancisco Top Host, Host Rep, Veteran
    edited May 2012

    @cedric said: Couldn't they just instal their 'tools' without needing to restore a disk image?

    Some of the 'blackhat' kits are full drive encrypted, pre loaded with TOR, all loaded from a RAM disk, no logging, encrypted memory, etc.

    It pretty much makes it that if whatever it lost power there's nothing left.

    Francisco

    Thanked by 2cedric djvdorp
  • netomxnetomx Moderator, Veteran

    @Francisco said: all loaded from a RAM disk, no logging, encrypted memory, etc.

    neat =0

Sign In or Register to comment.