{"id":4048,"date":"2020-06-29T15:59:00","date_gmt":"2020-06-29T15:59:00","guid":{"rendered":"http:\/\/jameseduard.com\/?p=4048"},"modified":"2020-06-29T15:59:00","modified_gmt":"2020-06-29T15:59:00","slug":"how-to-export-and-import-your-linux-systems-on-windows-10","status":"publish","type":"post","link":"https:\/\/www.jameseduard.com\/?p=4048","title":{"rendered":"How to Export and Import Your Linux Systems on Windows 10"},"content":{"rendered":"\n\n\n<p class=\"wp-block-paragraph\">In this article we will guide you on how to backup or export Windows Linux Subsystem in windows 10 and let you export intalled linux environment like ubuntu,kali or any linux distribution and also we will guide you how to import to other pc or workstation this will served as a clone copy of the WSL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. To export\/backup a Linux System open a PowerShell and run wsl command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To list the distros installed, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --list<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Run the&nbsp; following command to export a distro\u2019s file system to a TAR file:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --export distro_name file_name.tar<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. To export out Ubuntu 18.04 system to a file named Ubuntu-18.04.tar, we\u2019d run:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --export Ubuntu-18.04 Ubuntu-18.04.tar<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You now have a TAR file containing the Linux distribution\u2019s file system. My backup size around 4.79GB in size since i have pre-isntalled DevOps tools already and some repository. If you\u2019ve installed more software in your distribution, it will be larger.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How to Import (Restore) a Linux System<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the&nbsp;wsl&nbsp;command with the&nbsp;&#8211;import&nbsp;option to import a TAR file created in this way. From a PowerShell or Command Prompt window, run the following command<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --import distro_name install_location file_name.tar<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example, let\u2019s say you want to import a distro from a TAR file located at C:\\Users\\Chris\\ubuntu.tar, call it \u201cUbuntu-18.04,\u201d and store it at C:\\Users\\Chris\\ubuntu. You\u2019d run:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --import Ubuntu-18.04 C:\\Users\\Chris\\ubuntu C:\\Users\\Chris\\ubuntu.tar<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to match where Windows normally installs them to by default, they\u2019re in their own folder in C:\\Users\\NAME\\AppData\\Local\\Packages. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you might want to put Ubuntu<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">in\u00a0C:\\Users\\NAME\\AppData\\Local\\Packages\\Ubuntu.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wherever you put the install location, note that you shouldn\u2019t modify the files directly from Windows tools. Here\u2019s how you should access the files in File Explorer instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How to unregister or delete a Linux System<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can uninstall a distro with the&nbsp;&#8211;unregister&nbsp;option along with its name. This will result in all the Linux distribution\u2019s files being deleted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to see all installed distributions:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --list<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, specify the distribution you want to delete:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --unregister distro_name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if it\u2019s called Ubuntu-18.04, you\u2019d run:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">wsl --unregister Ubuntu-18.04<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This feature also lets you quickly and easily move installed distributions to another folder or drive. Just export the distro to a TAR file, unregister it from your system, and then import the TAR file to another location on your system.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we will guide you on how to backup or export Windows Linux Subsystem in windows 10 and let you export intalled linux environment like ubuntu,kali or any linux distribution and also we will guide you how to import to other pc or workstation this will served as a clone copy of the<\/p>\n","protected":false},"author":1,"featured_media":4049,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52,47,23,63],"tags":[46,22,51],"class_list":["post-4048","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-how-tos","category-linux","category-windows","tag-devops","tag-linux","tag-wsl"],"_links":{"self":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/4048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4048"}],"version-history":[{"count":0,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}