# Import VM Images

Need to migrate from your current solution to Antsle? No problem!

You can drag & drop your existing VM files to antman, and they will be imported as a template. That means you can create as many antlets from it as you want.

Whether you're migrating from VirtualBox, VMware or Hyper-V, we can import many formats:

* .raw
* .bochs
* .cloop
* .cow
* .dmg
* .iso
* .qcow
* .qcow2
* .qed
* .vmdk
* .vpc
* .img
* .vhd
* .vhdx

A .vdi image (VirtualBox native format) must be converted to a raw .img format first by running the following command on the machine that hosts VirtualBox.

```
VBoxManage clonemedium abc.vdi abc.img --format RAW
```

replace 'abc' with the name of your .vdi image.

If you want to import OVA or OVF files, please convert them to qcow2 before importing. Information on how to do the conversion is readily available on the web, e.g. [here](https://edoceo.com/notabene/ova-to-vmdk-to-qcow2).

### Import VM Image <a href="#import-vm-image" id="import-vm-image"></a>

#### Select 'Templates' and the 'Import' tab

From here you can either drag and drop your VM file or select 'Path' from the Image Source field. If you select 'Path' you must supply a path to the VM file. The pop-out in the image below shows a path to an external USB drive connected to the Antsle which contains the VM image file.

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-LzsgQx_8ptQVAqcj5RI%2F-LzstKgDmoZXGU88wCUn%2Fantman-import-image-dialog-v2.png?alt=media\&token=53595779-01ba-48a2-be49-f77229be2bc0)

{% hint style="info" %}
Note: If the original VM booted with UEFI, a new antlet created from the imported template will not boot on the antsle.
{% endhint %}

#### Prior to antMan v2.x

**1. Click 'Manage Templates' in Antman**

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-LzsgQx_8ptQVAqcj5RI%2F-LzsuNn968URa0o51WqM%2Fantman-manage-templates-button.png?alt=media\&token=92c38c73-0b3a-454b-99f8-1cd72503b241)

**2. In the Templates dialog click 'Import KVM/QEMU image' button**

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-LzsgQx_8ptQVAqcj5RI%2F-LzsuZQZ1T_wVelzLVDt%2Fantman-import-button.png?alt=media\&token=67dcd40f-3d36-4953-956a-85e98b148036)

**3. Drag your image file into the Import Image dialog**

![](https://2204297924-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LykQfPew0YJZLWKBUYz%2F-LzsgQx_8ptQVAqcj5RI%2F-LzsuhjoI25DrRF5ULgl%2Fantman-import-image-dialog.png?alt=media\&token=7f4992f1-2a20-4ade-b979-5ad64109bd60)

### Importing Virtual Drives

In case you have virtual drives attached to your VM being imported, and you want to import these virtual drives as well, here’s how to do it.

Let’s assume your drives are named `alice.vmdk` and `bob.vmdk`, and you want to attach them to antlet `Chris`.

Then just copy the virtual drive files to your Antsle.

On your Mac or Linux workstation, you can issue these commands:

```
ssh root@myantsle.local mkdir -p /antlets/Chris/antsle:volumes/
scp alice.vmdk bob.vmdk root@mayantsle.local:/antlets/Chris/antsle:volumes/
```

On Windows, you can use PuTTY and WinSCP instead.\
Or use [Filezilla with SFTP](https://docs.antsle.com/system/secure-ftp-sftp-access)

Then just edit the XML of your antlet `Chris`. See NOTE below before running the 'virsh edit' command.\
While logged in to the Antsle, for KVM antlets, run:

```
virsh edit Chris
```

if it’s an LXC antlet use the '-c lxc:///' option.

```
virsh -c lxc:/// edit Chris
```

NOTE: This will start a `vim` editor. If you are not familiar with vim, prefix the command with 'EDITOR=nano' to launch the nano text editor:

```
EDITOR=nano virsh edit Chris
```

Then find the \<devices> section in the XML. KVM antlets will have at least one \<disk> section inside the \<devices> section. LXC antlets by default do not have a \<disk> section.

Add a \<disk> block nested inside the \<devices> block for each virtual disk you are importing.\
Example:

```
<disk type='file' device='disk'>
      <source file='/antlets/Chris/antsle:volumes/alice.vmdk'/>
      <target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='disk'>
      <source file='/antlets/Chris/antsle:volumes/bob.vmdk'/>
      <target dev='hdb' bus='ide'/>
</disk>
```

You might have to change the names `hda` and `hdb` so that there is no conflict with other drives.

Save the XML, restart your antlet and you’re ready to go!<br>
