| Current Path : /snap/lxd/current/share/lxd-documentation/howto/import_machines_to_instances/ |
| Current File : //snap/lxd/current/share/lxd-documentation/howto/import_machines_to_instances/index.html |
<!doctype html>
<html class="no-js" lang="en" data-content_root="../../">
<head><meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="How to import physical or virtual machines to LXD instances" />
<meta property="og:type" content="website" />
<meta property="og:url" content="/howto/import_machines_to_instances/" />
<meta property="og:site_name" content="LXD documentation" />
<meta property="og:description" content="If you have an existing machine, either physical or virtual (VM or container), you can use the lxd-convert tool to create a LXD instance based on your existing disk or image. The tool copies the pr..." />
<meta property="og:image" content="https://documentation.ubuntu.com/lxd/latest/_static/lxd_tag.png" />
<meta property="og:image:alt" content="LXD documentation" />
<meta name="description" content="If you have an existing machine, either physical or virtual (VM or container), you can use the lxd-convert tool to create a LXD instance based on your existing disk or image. The tool copies the pr..." />
<meta property="article:modified_time" content="2026-02-12T14:01:41+00:00" /><link rel="index" title="Index" href="../../genindex/"><link rel="search" title="Search" href="../../search/"><link rel="next" title="How to pass an NVIDIA GPU to a container" href="../container_gpu_passthrough_with_docker/"><link rel="prev" title="How to migrate LXD instances between servers" href="../instances_migrate/">
<link rel="canonical" href="/howto/import_machines_to_instances/">
<link rel="shortcut icon" href="../../_static/favicon.ico"><!-- Generated with Sphinx 7.4.7 and Furo 2025.12.19 -->
<title>How to import physical or virtual machines to LXD instances - LXD documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=d111a655" />
<link rel="stylesheet" type="text/css" href="../../_static/styles/furo.css?v=7bdb33bb" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../../_static/config-options.css" />
<link rel="stylesheet" type="text/css" href="../../_static/related-links.css" />
<link rel="stylesheet" type="text/css" href="../../_static/terminal.css" />
<link rel="stylesheet" type="text/css" href="../../_static/youtube.css" />
<link rel="stylesheet" type="text/css" href="../../_static/sphinx-design.min.css?v=95c83b7e" />
<link rel="stylesheet" type="text/css" href="../../_static/styles/furo-extensions.css?v=8dab3a3b" />
<link rel="stylesheet" type="text/css" href="../../_static/lxd_custom.css?v=bfbf4da2" />
<link rel="stylesheet" type="text/css" href="../../_static/cookie-banner.css?v=b74831ab" />
<link rel="stylesheet" type="text/css" href="../../_static/custom.css?v=e189117a" />
<link rel="stylesheet" type="text/css" href="../../_static/header.css?v=a8078839" />
<link rel="stylesheet" type="text/css" href="../../_static/github_issue_links.css?v=3d761185" />
<link rel="stylesheet" type="text/css" href="../../_static/furo_colors.css?v=825fec6f" />
</head>
<body>
<header id="header" class="p-navigation">
<!-- Google Tag Manager -->
<script>
(function(w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0];
var j = d.createElement(s);
var dl = '';
if (l != 'dataLayer') {
dl = '&l=' + l;
}
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-KNX3CJC');
</script>
<div class="p-navigation__nav" role="menubar">
<ul class="p-navigation__links" role="menu">
<li>
<a class="p-logo" href="https://canonical.com/lxd" aria-current="page">
<img src="../../_static/lxd_tag.png" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">LXD
</div>
</a>
</li>
<li class="nav-ubuntu-com">
<a href="https://canonical.com/lxd" class="p-navigation__link">canonical.com/lxd</a>
</li>
<li class="nav-dropdown">
<a href="#" class="p-navigation__link nav-more-links"
id="more-resources-toggle"
aria-haspopup="true"
aria-expanded="false">
More resources
</a>
<ul class="more-links-dropdown" aria-labelledby="more-resources-toggle">
<li>
<a href="https://discourse.ubuntu.com/c/lxd/" class="p-navigation__sub-link p-dropdown__link">Discourse</a>
</li>
<li>
<a href="https://matrix.to/#/#documentation:ubuntu.com" class="p-navigation__sub-link p-dropdown__link">Matrix</a>
</li>
<li>
<a href="https://github.com/canonical/lxd" class="p-navigation__sub-link p-dropdown__link">GitHub</a>
</li>
</ul>
</li>
</ul>
</div>
</header>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-with-moon" viewBox="0 0 24 24">
<title>Auto light/dark, in light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
class="icon-custom-derived-from-feather-sun-and-tabler-moon">
<path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/>
<line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/>
<line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/>
<line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/>
<line x1="19" y1="14.05" x2="20.414" y2="15.464"/>
<line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/>
<line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/>
<line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/>
<line x1="19" y1="5.05" x2="20.414" y2="3.636"/>
<circle cx="14.5" cy="9.55" r="3.6"/>
</svg>
</symbol>
<symbol id="svg-moon-with-sun" viewBox="0 0 24 24">
<title>Auto light/dark, in dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1" stroke-linecap="round" stroke-linejoin="round"
class="icon-custom-derived-from-feather-sun-and-tabler-moon">
<path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/>
<line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/>
<line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/>
<line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/>
<line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/>
<line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/>
<line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/>
<line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/>
<line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/>
<circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/>
</svg>
</symbol>
<symbol id="svg-pencil" viewBox="0 0 24 24">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code">
<path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" />
<path d="M13.5 6.5l4 4" />
<path d="M20 21l2 -2l-2 -2" />
<path d="M17 17l-2 2l2 2" />
</svg>
</symbol>
<symbol id="svg-eye" viewBox="0 0 24 24">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path
d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" />
<path d="M20 21l2 -2l-2 -2" />
<path d="M17 17l-2 2l2 2" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle site navigation sidebar">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc" aria-label="Toggle table of contents sidebar">
<label class="overlay sidebar-overlay" for="__navigation"></label>
<label class="overlay toc-overlay" for="__toc"></label>
<a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<span class="icon"><svg><use href="#svg-menu"></use></svg></span>
</label>
</div>
<div class="header-center">
<a href="../../"><div class="brand">LXD documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<span class="icon"><svg><use href="#svg-toc"></use></svg></span>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="../../">
<span class="sidebar-brand-text">LXD documentation</span>
</a><form class="sidebar-search-container" method="get" action="../../search/" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
<input type="submit" value="Go">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../">LXD</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorial/first_steps/">Tutorial</a></li>
<li class="toctree-l1 current has-children"><a class="reference internal" href="../">How-to guides</a><input aria-label="Toggle navigation of How-to guides" checked="" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul class="current">
<li class="toctree-l2 has-children"><a class="reference internal" href="../../getting_started/">Getting started</a><input aria-label="Toggle navigation of Getting started" class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../installing/">Install LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../initialize/">Initialize LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../access_ui/">Access the UI</a></li>
<li class="toctree-l3"><a class="reference internal" href="../access_documentation/">Access documentation locally</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../operation/">LXD server and client</a><input aria-label="Toggle navigation of LXD server and client" class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../server_expose/">Expose LXD to the network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../server_configure/">Configure the LXD server</a></li>
<li class="toctree-l3 has-children"><a class="reference internal" href="../oidc/">Configure single sign-on with OIDC</a><input aria-label="Toggle navigation of Configure single sign-on with OIDC" class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l4"><a class="reference internal" href="../oidc_auth0/">How to configure Auth0</a></li>
<li class="toctree-l4"><a class="reference internal" href="../oidc_ory/">How to configure Ory Hydra</a></li>
<li class="toctree-l4"><a class="reference internal" href="../oidc_keycloak/">How to configure Keycloak</a></li>
<li class="toctree-l4"><a class="reference internal" href="../oidc_entra_id/">How to configure Entra ID</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../remotes/">Add remote servers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../lxc_alias/">Add command aliases</a></li>
</ul>
</li>
<li class="toctree-l2 current has-children"><a class="reference internal" href="../../instances/">Instances</a><input aria-label="Toggle navigation of Instances" checked="" class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../instances_create/">Create instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_configure/">Configure instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_manage/">Manage instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../profiles/">Use profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_troubleshoot/">Troubleshoot errors</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_ubuntu_pro_attach/">Auto attach Ubuntu Pro</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_access_files/">Access files</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_console/">Access the console</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../instance-exec/">Run commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-init/">Use cloud-init</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_routed_nic_vm/">Add a routed NIC to a VM</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_backup/">Back up instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_migrate/">Migrate instances</a></li>
<li class="toctree-l3 current current-page"><a class="current reference internal" href="#">Import existing machines</a></li>
<li class="toctree-l3"><a class="reference internal" href="../container_gpu_passthrough_with_docker/">Pass NVIDIA GPUs</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../images/">Images</a><input aria-label="Toggle navigation of Images" class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../images_remote/">Use remote images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_manage/">Manage images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_profiles/">Associate profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_copy/">Copy and import images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../images_create/">Create images</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../projects/">Projects</a><input aria-label="Toggle navigation of Projects" class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../projects_create/">Create and configure</a></li>
<li class="toctree-l3"><a class="reference internal" href="../projects_work/">Work with projects</a></li>
<li class="toctree-l3"><a class="reference internal" href="../projects_confine/">Confine users to projects</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../storage/">Storage</a><input aria-label="Toggle navigation of Storage" class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../storage_pools/">Manage pools</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_volumes/">Manage volumes</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_buckets/">Manage buckets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_create_instance/">Create an instance in a pool</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_backup_volume/">Back up a volume</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_move_volume/">Move or copy a volume</a></li>
<li class="toctree-l3"><a class="reference internal" href="../storage_csi/">Use the LXD CSI driver with Kubernetes</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../networks/">Networking</a><input aria-label="Toggle navigation of Networking" class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../network_create/">Create a network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_configure/">Configure a network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_bgp/">Configure as BGP server</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_acls/">Configure network ACLs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_forwards/">Configure forwards</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_zones/">Configure network zones</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_bridge_firewalld/">Configure your firewall</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_bridge_resolved/">Integrate with resolved</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ovn_setup/">Set up OVN</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_load_balancers/">Configure load balancers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ovn_peers/">Configure peer routing</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_ipam/">Display IPAM information</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../clustering/">Clustering</a><input aria-label="Toggle navigation of Clustering" class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../cluster_form/">Form a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_manage/">Manage a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_config_networks/">Configure networks</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_config_storage/">Configure storage</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_manage_instance/">Manage instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_groups/">Set up cluster groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_placement_groups/">Use placement groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_recover/">Recover a cluster</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cluster_vip/">Set up a highly available virtual IP</a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../production-setup/">Production setup</a><input aria-label="Toggle navigation of Production setup" class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../benchmark_performance/">Benchmark performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network_increase_bandwidth/">Increase bandwidth</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../metrics/">Monitor metrics</a></li>
<li class="toctree-l3"><a class="reference internal" href="../logs_loki/">Send logs to Loki</a></li>
<li class="toctree-l3"><a class="reference internal" href="../grafana/">Set up Grafana</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../backup/">Back up a server</a></li>
<li class="toctree-l3"><a class="reference internal" href="../disaster_recovery/">Recover instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../disaster_recovery_replication/">Disaster recovery with storage replication</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../snap/">Manage the snap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../security_harden/">Harden security</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../troubleshoot/">Troubleshooting</a><input aria-label="Toggle navigation of Troubleshooting" class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" role="switch" type="checkbox"/><label for="toctree-checkbox-12"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../network_bridge_firewalld/">Configure your firewall</a></li>
<li class="toctree-l3"><a class="reference internal" href="../instances_troubleshoot/">Troubleshoot instances</a></li>
<li class="toctree-l3"><a class="reference internal" href="../dqlite_troubleshoot/">Troubleshoot Dqlite</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../debugging/">Debug LXD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../faq/">Frequently asked</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../support/">Get support</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../contributing/">Contribute to LXD</a></li>
<li class="toctree-l2"><a class="reference internal" href="../auth_bearer/">How to authenticate to the LXD API using bearer tokens</a></li>
<li class="toctree-l2"><a class="reference internal" href="../devlxd_authenticate/">How to authenticate to the DevLXD API</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../explanation/">Explanation</a><input aria-label="Toggle navigation of Explanation" class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" role="switch" type="checkbox"/><label for="toctree-checkbox-13"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/lxd_lxc/"><code class="docutils literal notranslate"><span class="pre">lxd</span></code> and <code class="docutils literal notranslate"><span class="pre">lxc</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/instances/">Containers and VMs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../image-handling/">Local and remote images</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/storage/">Storage pools, volumes, and buckets</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/networks/">Networking setups</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../database/">The LXD Dqlite database</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/lxc_show_info/"><code class="docutils literal notranslate"><span class="pre">lxc</span></code> <code class="docutils literal notranslate"><span class="pre">show</span></code> and <code class="docutils literal notranslate"><span class="pre">info</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../authentication/">Remote API authentication</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/authorization/">Remote API authorization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/projects/">Instances grouping with projects</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/clusters/">Clusters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/performance_tuning/">Performance tuning</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/security/">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/bpf/">Privilege delegation using BPF Token</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../explanation/csi/">The LXD CSI driver</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../../reference/">Reference</a><input aria-label="Toggle navigation of Reference" class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" role="switch" type="checkbox"/><label for="toctree-checkbox-14"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../../requirements/">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../architectures/">Architectures</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/release-notes/">Release notes</a><input aria-label="Toggle navigation of Release notes" class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" role="switch" type="checkbox"/><label for="toctree-checkbox-15"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/release-notes/release-notes-6.7/">LXD 6.7</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/release-notes/release-notes-6.6/">LXD 6.6</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/releases-snap/">Releases and snap</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/remote_image_servers/">Remote image servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/image_format/">Image format</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../guest-os-compatibility/">Guest OS compatibility</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../container-environment/">Container environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../config-options/">Configuration option index</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../server/">Server configuration</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../explanation/instance_config/">Instance configuration</a><input aria-label="Toggle navigation of Instance configuration" class="toctree-checkbox" id="toctree-checkbox-16" name="toctree-checkbox-16" role="switch" type="checkbox"/><label for="toctree-checkbox-16"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/instance_properties/">Instance properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/instance_options/">Instance options</a></li>
<li class="toctree-l3 has-children"><a class="reference internal" href="../../reference/devices/">Devices</a><input aria-label="Toggle navigation of Devices" class="toctree-checkbox" id="toctree-checkbox-17" name="toctree-checkbox-17" role="switch" type="checkbox"/><label for="toctree-checkbox-17"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l4"><a class="reference internal" href="../../reference/standard_devices/">Standard devices</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_none/">Type: <code class="docutils literal notranslate"><span class="pre">none</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_nic/">Type: <code class="docutils literal notranslate"><span class="pre">nic</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_disk/">Type: <code class="docutils literal notranslate"><span class="pre">disk</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_unix_char/">Type: <code class="docutils literal notranslate"><span class="pre">unix-char</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_unix_block/">Type: <code class="docutils literal notranslate"><span class="pre">unix-block</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_usb/">Type: <code class="docutils literal notranslate"><span class="pre">usb</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_gpu/">Type: <code class="docutils literal notranslate"><span class="pre">gpu</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_infiniband/">Type: <code class="docutils literal notranslate"><span class="pre">infiniband</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_proxy/">Type: <code class="docutils literal notranslate"><span class="pre">proxy</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_unix_hotplug/">Type: <code class="docutils literal notranslate"><span class="pre">unix-hotplug</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_tpm/">Type: <code class="docutils literal notranslate"><span class="pre">tpm</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="../../reference/devices_pci/">Type: <code class="docutils literal notranslate"><span class="pre">pci</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/instance_units/">Units for storage and network limits</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/preseed_yaml_fields/">Preseed YAML file fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/projects/">Project configuration</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/storage_drivers/">Storage drivers</a><input aria-label="Toggle navigation of Storage drivers" class="toctree-checkbox" id="toctree-checkbox-18" name="toctree-checkbox-18" role="switch" type="checkbox"/><label for="toctree-checkbox-18"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_dir/">Directory - <code class="docutils literal notranslate"><span class="pre">dir</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_btrfs/">Btrfs - <code class="docutils literal notranslate"><span class="pre">btrfs</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_lvm/">LVM - <code class="docutils literal notranslate"><span class="pre">lvm</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_zfs/">ZFS - <code class="docutils literal notranslate"><span class="pre">zfs</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_ceph/">Ceph RBD - <code class="docutils literal notranslate"><span class="pre">ceph</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_powerflex/">Dell PowerFlex - <code class="docutils literal notranslate"><span class="pre">powerflex</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_pure/">Pure Storage - <code class="docutils literal notranslate"><span class="pre">pure</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_alletra/">HPE Alletra - <code class="docutils literal notranslate"><span class="pre">alletra</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_cephfs/">CephFS - <code class="docutils literal notranslate"><span class="pre">cephfs</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/storage_cephobject/">Ceph Object - <code class="docutils literal notranslate"><span class="pre">cephobject</span></code></a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/networks/">Networks</a><input aria-label="Toggle navigation of Networks" class="toctree-checkbox" id="toctree-checkbox-19" name="toctree-checkbox-19" role="switch" type="checkbox"/><label for="toctree-checkbox-19"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_bridge/">Bridge network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_ovn/">OVN network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_macvlan/">Macvlan network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_physical/">Physical network</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/network_sriov/">SR-IOV network</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/cluster_member_config/">Cluster configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/placement_groups/">Placement group configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/server_settings/">Production server settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/provided_metrics/">Provided metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/permissions/">Permissions</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../restapi_landing/">REST API</a><input aria-label="Toggle navigation of REST API" class="toctree-checkbox" id="toctree-checkbox-20" name="toctree-checkbox-20" role="switch" type="checkbox"/><label for="toctree-checkbox-20"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../rest-api/">Main API documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../api/">Main API specification</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../api-extensions/">Main API extensions</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../events/">Events API documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../dev-lxd/">Instance API</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../reference/driver_csi/">LXD CSI driver reference</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../reference/manpages/">Man pages</a><input aria-label="Toggle navigation of Man pages" class="toctree-checkbox" id="toctree-checkbox-21" name="toctree-checkbox-21" role="switch" type="checkbox"/><label for="toctree-checkbox-21"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../reference/manpages/lxc/"><code class="docutils literal notranslate"><span class="pre">lxc</span></code></a></li>
</ul>
</li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../../internals/">Internals</a><input aria-label="Toggle navigation of Internals" class="toctree-checkbox" id="toctree-checkbox-22" name="toctree-checkbox-22" role="switch" type="checkbox"/><label for="toctree-checkbox-22"><span class="icon"><svg><use href="#svg-arrow-right"></use></svg></span></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../../environment/">Environment variables</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/uefi_variables/">UEFI variables for VMs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../daemon-behavior/">Daemon behavior</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../syscall-interception/">System call interception</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../userns-idmap/">User namespace setup</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/ovn-internals/">OVN implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/vm_live_migration_internals/">VM live migration implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../reference/dqlite-internals/">Dqlite</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="https://github.com/canonical/lxd">Project repository</a></li>
<li class="toctree-l2"><a class="reference external" href="https://images.lxd.canonical.com">Image server</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<a href="#" class="back-to-top muted-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
</svg>
<span>Back to top</span>
</a>
<div class="content-icon-container">
<div class="edit-this-page">
<a class="muted-link" href="https://github.com/canonical/lxd/edit/main/doc/howto/import_machines_to_instances.md" title="Contribute to this page">
<svg><use href="#svg-pencil"></use></svg>
<span class="visually-hidden">Contribute to this page</span>
</a>
</div><div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
<svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
<svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<span class="icon"><svg><use href="#svg-toc"></use></svg></span>
</label>
</div>
<article role="main" id="furo-main-content">
<section id="how-to-import-physical-or-virtual-machines-to-lxd-instances">
<span id="import-machines-to-instances"></span><h1>How to import physical or virtual machines to LXD instances<a class="headerlink" href="#how-to-import-physical-or-virtual-machines-to-lxd-instances" title="Link to this heading">¶</a></h1>
<p class="youtube_link">
<a href="https://www.youtube.com/watch?v=F9GALjHtnUU" target="_blank">
<span title="Importing systems into LXD" class="play_icon">▶</span>
<span title="Importing systems into LXD">Watch on YouTube</span>
</a>
</p>
<p>If you have an existing machine, either physical or virtual (VM or container), you can use the <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> tool to create a LXD instance based on your existing disk or image.</p>
<p>The tool copies the provided partition, disk or image to the LXD storage pool of the provided LXD server, sets up an instance using that storage and allows you to configure additional settings for the new instance.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you want to configure your new instance during the conversion process, set up the entities that you want your instance to use before starting the conversion process.</p>
<p>By default, the new instance will use the entities specified in the <code class="docutils literal notranslate"><span class="pre">default</span></code> profile.
You can specify a different profile (or a profile list) to customize the configuration.
See <a class="reference internal" href="../../profiles/#profiles"><span class="std std-ref">How to use profiles</span></a> for more information.
You can also override <a class="reference internal" href="../../reference/instance_options/#instance-options"><span class="std std-ref">Instance options</span></a>, the <a class="reference internal" href="../../explanation/storage/#storage-pools"><span class="std std-ref">storage pool</span></a> to be used and the size for the <a class="reference internal" href="../../explanation/storage/#storage-volumes"><span class="std std-ref">storage volume</span></a>, and the <a class="reference internal" href="../../networks/#networking"><span class="std std-ref">network</span></a> to be used.</p>
<p>Alternatively, you can update the instance configuration after the conversion is complete.</p>
</div>
<p>The tool can create both containers and virtual machines:</p>
<ul class="simple">
<li><p>When creating a container, you must provide a disk or partition that contains the root file system for the container.
For example, this could be the <code class="docutils literal notranslate"><span class="pre">/</span></code> root disk of the machine or container where you are running the tool.</p></li>
<li><p>When creating a virtual machine, you must provide a bootable disk, partition, or an image in raw, QCOW, QCOW2, VDI, VHDX, or VMDK format.
This means that just providing a file system is not sufficient, and you cannot create a virtual machine from a container that you are running.
It is also not possible to create a virtual machine from the physical machine that you are using to do the conversion, because the conversion tool would be using the disk that it is copying.
Instead, you could provide a bootable image, or a bootable partition or disk that is currently not in use.</p></li>
</ul>
<p>The tool can also inject the required VIRTIO drivers into the image:</p>
<ul>
<li><p>To convert the image into raw format and inject the VIRTIO drivers during the conversion, use the following command:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lxd-convert --options=format,virtio
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The conversion option <code class="docutils literal notranslate"><span class="pre">virtio</span></code> requires <code class="docutils literal notranslate"><span class="pre">virt-v2v-in-place</span></code> to be installed on the host where the LXD server runs.</p>
</div>
</li>
<li><p>For converting Windows images from a foreign hypervisor (not from QEMU/KVM with Q35/<code class="docutils literal notranslate"><span class="pre">virtio-scsi</span></code>), you must install additional drivers on the host:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">/usr/share/virtio-win/virtio-win.iso</span></code></p>
<p>Download <a class="reference external" href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso"><code class="docutils literal notranslate"><span class="pre">virtio-win.iso</span></code></a>.</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">/usr/share/virt-tools/rhsrvany.exe</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">/usr/share/virt-tools/pnp_wait.exe</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">rhsrvany.exe</span></code> and <code class="docutils literal notranslate"><span class="pre">pnp_wait.exe</span></code> are provided in Ubuntu 24.04 and later in
the <a class="reference external" href="https://launchpad.net/ubuntu/+source/rhsrvany"><code class="docutils literal notranslate"><span class="pre">rhsrvany</span></code></a> package.
For other OS versions, download <a class="reference external" href="https://github.com/rwmjones/rhsrvany?tab=readme-ov-file#binary-releases"><code class="docutils literal notranslate"><span class="pre">rhsrvany.exe</span></code> and <code class="docutils literal notranslate"><span class="pre">pnp_wait.exe</span></code></a>.</p>
</li>
</ul>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>The <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> command with the <code class="docutils literal notranslate"><span class="pre">--options=format,virtio</span></code> option automatically converts the image and injects the VIRTIO drivers during the conversion.
However, if you want to manually convert a Windows VM from a foreign hypervisor, you must install both the required Windows drivers (as described above) and <code class="docutils literal notranslate"><span class="pre">virt-v2v</span></code> (>= 2.3.4).</p>
<details>
<summary>Expand to see how to convert your Windows VM using <code>virt-v2v</code></summary>
<p>Use <code class="docutils literal notranslate"><span class="pre">virt-v2v</span></code> to convert Windows image into <code class="docutils literal notranslate"><span class="pre">raw</span></code> format and include the required drivers.
The resulting image is suitable for use with <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code>.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Example 1. Convert a VMDK image to a raw image</span>
<span class="n">sudo</span> <span class="n">virt</span><span class="o">-</span><span class="n">v2v</span> <span class="o">--</span><span class="n">block</span><span class="o">-</span><span class="n">driver</span> <span class="n">virtio</span><span class="o">-</span><span class="n">scsi</span> <span class="o">-</span><span class="n">o</span> <span class="n">local</span> <span class="o">-</span><span class="n">of</span> <span class="n">raw</span> <span class="o">-</span><span class="n">os</span> <span class="o">./</span><span class="n">os</span> <span class="o">-</span><span class="n">i</span> <span class="n">disk</span> <span class="o">-</span><span class="k">if</span> <span class="n">vmdk</span> <span class="n">test</span><span class="o">-</span><span class="n">vm</span><span class="o">-</span><span class="n">disk</span><span class="o">.</span><span class="n">vmdk</span>
<span class="c1"># Example 2. Convert a QEMU/KVM qcow2 image to a raw image</span>
<span class="n">sudo</span> <span class="n">virt</span><span class="o">-</span><span class="n">v2v</span> <span class="o">--</span><span class="n">block</span><span class="o">-</span><span class="n">driver</span> <span class="n">virtio</span><span class="o">-</span><span class="n">scsi</span> <span class="o">-</span><span class="n">o</span> <span class="n">local</span> <span class="o">-</span><span class="n">of</span> <span class="n">raw</span> <span class="o">-</span><span class="n">os</span> <span class="o">./</span><span class="n">os</span> <span class="o">-</span><span class="n">i</span> <span class="n">disk</span> <span class="o">-</span><span class="k">if</span> <span class="n">qcow2</span> <span class="n">test</span><span class="o">-</span><span class="n">vm</span><span class="o">-</span><span class="n">disk</span><span class="o">.</span><span class="n">qcow2</span>
<span class="c1"># Example 3. Convert a VMX image to a raw image</span>
<span class="n">sudo</span> <span class="n">virt</span><span class="o">-</span><span class="n">v2v</span> <span class="o">--</span><span class="n">block</span><span class="o">-</span><span class="n">driver</span> <span class="n">virtio</span><span class="o">-</span><span class="n">scsi</span> <span class="o">-</span><span class="n">o</span> <span class="n">local</span> <span class="o">-</span><span class="n">of</span> <span class="n">raw</span> <span class="o">-</span><span class="n">os</span> <span class="o">./</span><span class="n">os</span> <span class="o">-</span><span class="n">i</span> <span class="n">vmx</span> <span class="o">./</span><span class="n">test</span><span class="o">-</span><span class="n">vm</span><span class="o">.</span><span class="n">vmx</span>
</pre></div>
</div>
<p>You can find the resulting image in the <code class="docutils literal notranslate"><span class="pre">os</span></code> directory and use it with <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> on the next steps.
In addition, when migrating already converted images, <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> conversion options are not necessary.</p>
</details>
</div>
</li>
</ul>
<section id="interactive-instance-import">
<h2>Interactive instance import<a class="headerlink" href="#interactive-instance-import" title="Link to this heading">¶</a></h2>
<p>Complete the following steps to convert an existing machine to a LXD instance:</p>
<ol class="arabic">
<li><p>Download the <code class="docutils literal notranslate"><span class="pre">bin.linux.lxd-convert</span></code> tool (<a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.linux.lxd-convert.aarch64"><code class="docutils literal notranslate"><span class="pre">bin.linux.lxd-convert.aarch64</span></code></a> or <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.linux.lxd-convert.x86_64"><code class="docutils literal notranslate"><span class="pre">bin.linux.lxd-convert.x86_64</span></code></a>) from the <strong>Assets</strong> section of the latest <a class="reference external" href="https://github.com/canonical/lxd/releases">LXD release</a>.</p></li>
<li><p>Place the tool on the machine that you want to use to create the instance.
Make it executable (usually by running <code class="docutils literal notranslate"><span class="pre">chmod</span> <span class="pre">u+x</span> <span class="pre">bin.linux.lxd-convert</span></code>).</p></li>
<li><p>Make sure that the machine has <code class="docutils literal notranslate"><span class="pre">rsync</span></code> and <code class="docutils literal notranslate"><span class="pre">file</span></code> installed.
If they are missing, install them (for example, with <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt</span> <span class="pre">install</span> <span class="pre">rsync</span> <span class="pre">file</span></code>).</p></li>
<li><p>Run the tool:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>sudo ./bin.linux.lxd-convert
</pre></div>
</div>
<p>The tool then asks you to provide the information required for the conversion.</p>
<ol class="arabic">
<li><p>Specify the LXD server URL, either as an IP address or as a DNS name.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The LXD server must be <a class="reference internal" href="../server_expose/#server-expose"><span class="std std-ref">exposed to the network</span></a>.
If you want to import to a local LXD server, you must still expose it to the network.
You can then specify <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span></code> as the IP address to access the local server.</p>
</div>
</li>
<li><p>Check and confirm the certificate fingerprint.</p></li>
<li><p>Choose a method for authentication (see <a class="reference internal" href="../../authentication/#authentication"><span class="std std-ref">Remote API authentication</span></a>).</p>
<p>For example, if you choose using a certificate token, log on to the LXD server and create a token for the machine on which you are running the conversion tool with <a class="reference internal" href="../../reference/manpages/lxc/config/trust/add/#lxc-config-trust-add-md"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">lxc</span> <span class="pre">config</span> <span class="pre">trust</span> <span class="pre">add</span></code></span></a>.
Then use the generated token to authenticate the tool.</p>
</li>
<li><p>Choose whether to create a container or a virtual machine.
See <a class="reference internal" href="../../explanation/instances/#containers-and-vms"><span class="std std-ref">Containers and VMs</span></a>.</p></li>
<li><p>Specify a name for the instance that you are creating.</p></li>
<li><p>Provide the path to a root file system (for containers) or a bootable disk, partition or image file (for virtual machines).</p></li>
<li><p>For containers, optionally add additional file system mounts.</p></li>
<li><p>For virtual machines, specify whether secure boot is supported.</p></li>
<li><p>Optionally, configure the new instance.
You can do so by specifying <a class="reference internal" href="../../profiles/#profiles"><span class="std std-ref">profiles</span></a>, directly setting <a class="reference internal" href="../../reference/instance_options/#instance-options"><span class="std std-ref">configuration options</span></a> or changing <a class="reference internal" href="../../storage/#storage"><span class="std std-ref">storage</span></a> or <a class="reference internal" href="../../networks/#networking"><span class="std std-ref">network</span></a> settings.</p>
<p>Alternatively, you can configure the new instance after the conversion.</p>
</li>
<li><p>When you are done with the configuration, start the conversion process.</p></li>
</ol>
<details>
<summary>Expand to see an example output for importing to a container</summary>
<div class="terminal docutils container">
<div class="input docutils container">
<div class="prompt docutils container">
<code class="docutils literal notranslate"><span class="pre">user@host:~$</span> </code></div>
<span class="command"><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">./bin.linux.lxd-convert</span>
</code></span></div>
<div class="terminal-code highlight-text notranslate"><div class="highlight"><pre><span></span>Please provide LXD server URL: https://192.0.2.7:8443
Certificate fingerprint: xxxxxxxxxxxxxxxxx
ok (y/n)? y
1) Use a certificate token
2) Use an existing TLS authentication certificate
3) Generate a temporary TLS authentication certificate
Please pick an authentication mechanism above: 1
Please provide the certificate token: xxxxxxxxxxxxxxxx
Remote LXD server:
Hostname: bar
Version: 5.4
Would you like to create a container (1) or virtual-machine (2)?: 1
Name of the new instance: foo
Please provide the path to a root filesystem: /
Do you want to add additional filesystem mounts? [default=no]:
Instance to be created:
Name: foo
Project: default
Type: container
Source: /
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 3
Please specify config keys and values (key=value ...): limits.cpu=2
Instance to be created:
Name: foo
Project: default
Type: container
Source: /
Config:
limits.cpu: "2"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 4
Please provide the storage pool to use: default
Do you want to change the storage volume size? [default=no]: yes
Please specify the storage volume size: 20GiB
Instance to be created:
Name: foo
Project: default
Type: container
Source: /
Storage pool: default
Storage volume size: 20GiB
Config:
limits.cpu: "2"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 5
Please specify the network to use for the instance: lxdbr0
Instance to be created:
Name: foo
Project: default
Type: container
Source: /
Storage pool: default
Storage volume size: 20GiB
Network name: lxdbr0
Config:
limits.cpu: "2"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 1
Instance foo successfully created
</pre></div>
</div>
</div>
</details>
<details>
<summary>Expand to see an example output for importing to a VM</summary>
<div class="terminal docutils container">
<div class="input docutils container">
<div class="prompt docutils container">
<code class="docutils literal notranslate"><span class="pre">user@host:~$</span> </code></div>
<span class="command"><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">./bin.linux.lxd-convert</span>
</code></span></div>
<div class="terminal-code highlight-text notranslate"><div class="highlight"><pre><span></span>Please provide LXD server URL: https://192.0.2.7:8443
Certificate fingerprint: xxxxxxxxxxxxxxxxx
ok (y/n)? y
1) Use a certificate token
2) Use an existing TLS authentication certificate
3) Generate a temporary TLS authentication certificate
Please pick an authentication mechanism above: 1
Please provide the certificate token: xxxxxxxxxxxxxxxx
Remote LXD server:
Hostname: bar
Version: 5.4
Would you like to create a container (1) or virtual-machine (2)?: 2
Name of the new instance: foo
Please provide the path to a root filesystem: ./virtual-machine.img
Does the VM support UEFI Secure Boot? [default=no]: no
Instance to be created:
Name: foo
Project: default
Type: virtual-machine
Source: ./virtual-machine.img
Config:
boot.mode: "uefi-nosecureboot"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 3
Please specify config keys and values (key=value ...): limits.cpu=2
Instance to be created:
Name: foo
Project: default
Type: virtual-machine
Source: ./virtual-machine.img
Config:
boot.mode: "uefi-nosecureboot"
limits.cpu: "2"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 4
Please provide the storage pool to use: default
Do you want to change the storage volume size? [default=no]: yes
Please specify the storage volume size: 20GiB
Instance to be created:
Name: foo
Project: default
Type: virtual-machine
Source: ./virtual-machine.img
Storage pool: default
Storage volume size: 20GiB
Config:
boot.mode: "uefi-nosecureboot"
limits.cpu: "2"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 5
Please specify the network to use for the instance: lxdbr0
Instance to be created:
Name: foo
Project: default
Type: virtual-machine
Source: ./virtual-machine.img
Storage pool: default
Storage volume size: 20GiB
Network name: lxdbr0
Config:
boot.mode: "uefi-nosecureboot"
limits.cpu: "2"
Additional overrides can be applied at this stage:
1) Begin the conversion with the above configuration
2) Override profile list
3) Set additional configuration options
4) Change instance storage pool or volume size
5) Change instance network
Please pick one of the options above [default=1]: 1
Instance foo successfully created
</pre></div>
</div>
</div>
</details>
</li>
<li><p>When the conversion is complete, check the new instance and update its configuration to the new environment.
Typically, you must update at least the storage configuration (<code class="docutils literal notranslate"><span class="pre">/etc/fstab</span></code>) and the network configuration.</p></li>
</ol>
</section>
<section id="non-interactive-instance-import">
<h2>Non-interactive instance import<a class="headerlink" href="#non-interactive-instance-import" title="Link to this heading">¶</a></h2>
<p>Alternatively, the entire instance import configuration can be provided using <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> flags.
If any required flag is missing, <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> will interactively prompt for the missing value.
However, when the <code class="docutils literal notranslate"><span class="pre">--non-interactive</span></code> flag is used, an error is returned instead.</p>
<p>Note that if any flag contains an invalid value, an error is returned regardless of the mode (interactive or non-interactive).</p>
<p>The <code class="docutils literal notranslate"><span class="pre">lxd-convert</span></code> command supports the following flags that can be used in non-interactive conversion:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Instance</span> <span class="n">configuration</span><span class="p">:</span>
<span class="o">-</span><span class="n">c</span><span class="p">,</span> <span class="o">--</span><span class="n">config</span> <span class="n">Config</span> <span class="n">key</span><span class="o">/</span><span class="n">value</span> <span class="n">to</span> <span class="n">apply</span> <span class="n">to</span> <span class="n">the</span> <span class="n">new</span> <span class="n">instance</span>
<span class="o">--</span><span class="n">mount</span><span class="o">-</span><span class="n">path</span> <span class="n">Additional</span> <span class="n">container</span> <span class="n">mount</span> <span class="n">paths</span>
<span class="o">--</span><span class="n">name</span> <span class="n">Name</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">instance</span>
<span class="o">--</span><span class="n">network</span> <span class="n">Network</span> <span class="n">name</span>
<span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">profiles</span> <span class="n">Create</span> <span class="n">the</span> <span class="n">instance</span> <span class="k">with</span> <span class="n">no</span> <span class="n">profiles</span> <span class="n">applied</span>
<span class="o">--</span><span class="n">profiles</span> <span class="n">Profiles</span> <span class="n">to</span> <span class="n">apply</span> <span class="n">on</span> <span class="n">the</span> <span class="n">new</span> <span class="n">instance</span> <span class="p">(</span><span class="n">default</span> <span class="p">[</span><span class="n">default</span><span class="p">])</span>
<span class="o">--</span><span class="n">project</span> <span class="n">Project</span> <span class="n">name</span>
<span class="o">--</span><span class="n">source</span> <span class="n">Path</span> <span class="n">to</span> <span class="n">the</span> <span class="n">root</span> <span class="n">filesystem</span> <span class="k">for</span> <span class="n">containers</span><span class="p">,</span> <span class="ow">or</span> <span class="n">to</span> <span class="n">the</span> <span class="n">block</span> <span class="n">device</span> <span class="ow">or</span> <span class="n">disk</span> <span class="n">image</span> <span class="n">file</span> <span class="k">for</span> <span class="n">virtual</span> <span class="n">machines</span>
<span class="o">--</span><span class="n">storage</span> <span class="n">Storage</span> <span class="n">pool</span> <span class="n">name</span>
<span class="o">--</span><span class="n">storage</span><span class="o">-</span><span class="n">size</span> <span class="n">Size</span> <span class="n">of</span> <span class="n">the</span> <span class="n">instance</span><span class="s1">'s storage volume</span>
<span class="o">--</span><span class="nb">type</span> <span class="n">Type</span> <span class="n">of</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">to</span> <span class="n">create</span> <span class="p">(</span><span class="n">container</span> <span class="ow">or</span> <span class="n">vm</span><span class="p">)</span>
<span class="n">Target</span> <span class="n">server</span><span class="p">:</span>
<span class="o">--</span><span class="n">server</span> <span class="n">Unix</span> <span class="ow">or</span> <span class="n">HTTPS</span> <span class="n">URL</span> <span class="n">of</span> <span class="n">the</span> <span class="n">target</span> <span class="n">server</span>
<span class="o">--</span><span class="n">token</span> <span class="n">Authentication</span> <span class="n">token</span> <span class="k">for</span> <span class="n">HTTPS</span> <span class="n">remote</span>
<span class="o">--</span><span class="n">cert</span><span class="o">-</span><span class="n">path</span> <span class="n">Trusted</span> <span class="n">certificate</span> <span class="n">path</span>
<span class="o">--</span><span class="n">key</span><span class="o">-</span><span class="n">path</span> <span class="n">Trusted</span> <span class="n">certificate</span> <span class="n">path</span>
<span class="n">Other</span><span class="p">:</span>
<span class="o">--</span><span class="n">options</span> <span class="n">strings</span> <span class="n">Comma</span><span class="o">-</span><span class="n">separated</span> <span class="nb">list</span> <span class="n">of</span> <span class="n">conversion</span> <span class="n">options</span> <span class="n">to</span> <span class="n">apply</span><span class="o">.</span> <span class="n">Allowed</span> <span class="n">values</span> <span class="n">are</span><span class="p">:</span> <span class="p">[</span><span class="nb">format</span><span class="p">,</span> <span class="n">virtio</span><span class="p">]</span> <span class="p">(</span><span class="n">default</span> <span class="p">[</span><span class="nb">format</span><span class="p">])</span>
<span class="o">--</span><span class="n">non</span><span class="o">-</span><span class="n">interactive</span> <span class="n">Prevent</span> <span class="n">further</span> <span class="n">interaction</span> <span class="k">if</span> <span class="n">conversion</span> <span class="n">questions</span> <span class="n">are</span> <span class="n">incomplete</span>
<span class="o">--</span><span class="n">rsync</span><span class="o">-</span><span class="n">args</span> <span class="n">Extra</span> <span class="n">arguments</span> <span class="n">to</span> <span class="k">pass</span> <span class="n">to</span> <span class="n">rsync</span>
</pre></div>
</div>
<p>Example VM import to local LXD server:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>lxd-convert<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--name<span class="w"> </span>v1<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--type<span class="w"> </span>vm<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--source<span class="w"> </span><span class="s2">"</span><span class="si">${</span><span class="nv">sourcePath</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--non-interactive
</pre></div>
</div>
<p>Example VM import to remote HTTPS server:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Token from remote server.</span>
<span class="nv">token</span><span class="o">=</span><span class="k">$(</span>lxc<span class="w"> </span>config<span class="w"> </span>trust<span class="w"> </span>add<span class="w"> </span>--name<span class="w"> </span>lxd-convert<span class="w"> </span>--quiet<span class="k">)</span>
lxd-convert<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--server<span class="w"> </span>https://example.com:8443<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--token<span class="w"> </span><span class="s2">"</span><span class="nv">$token</span><span class="s2">"</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--name<span class="w"> </span>v1<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--type<span class="w"> </span>vm<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--source<span class="w"> </span><span class="s2">"</span><span class="si">${</span><span class="nv">sourcePath</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--non-interactive
</pre></div>
</div>
<p>Example VM import with secure boot disabled and custom resource limits:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>lxd-convert<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--name<span class="w"> </span>v1<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--type<span class="w"> </span>vm<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--source<span class="w"> </span><span class="s2">"</span><span class="si">${</span><span class="nv">sourcePath</span><span class="si">}</span><span class="s2">"</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--config<span class="w"> </span>boot.mode<span class="o">=</span>uefi-nosecureboot<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--config<span class="w"> </span>limits.cpu<span class="o">=</span><span class="m">4</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--config<span class="w"> </span>limits.memory<span class="o">=</span>4GiB<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--non-interactive
</pre></div>
</div>
</section>
</section>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="../container_gpu_passthrough_with_docker/">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">How to pass an NVIDIA GPU to a container</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="../instances_migrate/">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">How to migrate LXD instances between servers</div>
</div>
</a>
</div>
<div class="bottom-of-page">
<div class="left-details">
<div class="copyright">
© 2014-2026 AGPL-3.0, LXD contributors
</div><div class="last-updated">
Last updated on Feb 12, 2026</div>
</div>
<div class="right-details">
<a href="" class="js-revoke-cookie-manager muted-link">Manage your tracker settings</a>
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
Contents
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">How to import physical or virtual machines to LXD instances</a><ul>
<li><a class="reference internal" href="#interactive-instance-import">Interactive instance import</a></li>
<li><a class="reference internal" href="#non-interactive-instance-import">Non-interactive instance import</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div><script src="../../_static/jquery.js?v=5d32c60e"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../../_static/documentation_options.js?v=a5603611"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/scripts/furo.js?v=46bd48cc"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=b01cb6f2"></script>
<script src="../../_static/config-options.js"></script>
<script src="../../_static/design-tabs.js?v=f930bc37"></script>
<script src="../../_static/js/bundle.js?v=a4d88309"></script>
<script src="../../_static/header-nav.js?v=e117ad08"></script>
<script src="../../_static/github_issue_links.js?v=32bb732f"></script>
<script>
const github_url = "https://github.com/canonical/lxd";
</script>
</body>
</html>