Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline distribution #8031

Open
ilingleb117 opened this issue Feb 8, 2022 · 22 comments
Open

Offline distribution #8031

ilingleb117 opened this issue Feb 8, 2022 · 22 comments
Labels

Comments

@ilingleb117
Copy link

ilingleb117 commented Feb 8, 2022

Following these instructions you can't run installed Linux distribution without internet because any UWP app requires check licence through active online connection.

Suggestion

Add license file download option like release Windows Termimal (see non preview version) for example. Then the installation command will look like this:
DISM.exe /Online /Add-ProvisionedAppxPackage /PackagePath:Ubuntu.appxbundle /License:Ubuntu.xml

@ilingleb117 ilingleb117 changed the title Offline install Appx/AppxBundle Offline distribution Mar 15, 2022
@MrDaGree
Copy link

I would love this! I have many systems that I'd love to install on but not all have internet at once

@djlongy
Copy link

djlongy commented Aug 4, 2022

+1 for offline distribution like Windows Terminal with the license file.

@kumori123
Copy link

+1

@Biswa96
Copy link

Biswa96 commented Jan 4, 2023

Installing Linux distributions offline is available since the inception of WSL. For new users, the WSL from Windows Store makes it even easier from command line. See this blog post https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-in-the-microsoft-store-is-now-generally-available-on-windows-10-and-11/

@kumori123
Copy link

Thank you for your reply!Unfortunately, I still have no idea on how to install the linux distribution offline since those commands introduced are online-necessary, would you have any suggestions on it?

@Biswa96
Copy link

Biswa96 commented Jan 4, 2023

There are multiple ways it can be done. I would suggest to look into various Superuser or Stackoverflow threads out there. If those do not help please provide the preferred way you want to install it. Like the current situation, what are the steps or websites are allowed etc.

@kumori123
Copy link

Thank you for your reply! I'm now trying to install WSL2 without internet connection. I did the same as the manual tutorial https://learn.microsoft.com/en-us/windows/wsl/install-manual
and after I installed the distribution, the installation seemed to be successful without any error message. But then when I tried to start the distribution, just nothing happened. I tried rebooting, reinstallation but all these things not work.
I search this issue on internet, but less useful information beside this thread which told me that offline installation is unrealistic.
I will appreciate it if you have any suggestions.

@Biswa96
Copy link

Biswa96 commented Jan 4, 2023

Which distribution did you install and using which command?

@kumori123
Copy link

I used the ubuntu20.04, using command like

Add-AppxPackage .\CanonicalGroupLimited.UbuntuonWindows_2004.2021.825.0.AppxBundle

also I tried just double click the appx, the result is the same.

@Biswa96
Copy link

Biswa96 commented Jan 4, 2023

IIRC there is an issue about the AppxBundle file. I hope the following method do not create another problem. This may not be the most user friendly way to install the package but it just works 😌

AppxBundle, as the name suggests, is a bundle of multiple Appx files. So the procedure is to extract the correct Appx, then extract the actual required files from it. For the Ubuntu 20.04 case (as Kumori123 asked), it would be

CanonicalGroupLimited.UbuntuonWindows_2004.2021.825.0.AppxBundle
↓
Ubuntu_2004.2021.825.0_x64.appx
↓
install.tar.gz and ubuntu.exe

The AppxBundle and Appx is just ZIP file. Use any tool as you want. Extract install.tar.gz and ubuntu.exe in any folder. Double click on ubuntu.exe and the rest will be as usual.

@bwgjoseph
Copy link

I have written an article about installing the entire WSL + Ubuntu distribution in offline mode.

In short, it has something to do with permission, which I can't figure out why. But you can simply copy out the installed applications to any directory (e.g c:) and you will be able to access normally. This happens to all packages like windows terminal and so on

@Biswa96
Copy link

Biswa96 commented Jan 4, 2023

I have written an article about installing the entire WSL + Ubuntu distribution in offline mode.

Little suggestion. Try NOT to do or change anything with C:\Program Files\WindowsApp directory. It may work at that time but things may start to break apart. There are many issues about it. Instead of copying from that directory, just extract the Appx file as above.

@bwgjoseph
Copy link

Little suggestion. Try NOT to do or change anything with C:\Program Files\WindowsApp directory. It may work at that time but things may start to break apart. There are many issues about it. Instead of copying from that directory, just extract the Appx file as above.

Thanks for the suggestion.

May I get some references on the issues that you are talking about?

@bwgjoseph
Copy link

IIRC there is an issue about the AppxBundle file. I hope the following method do not create another problem. This may not be the most user friendly way to install the package but it just works 😌

AppxBundle, as the name suggests, is a bundle of multiple Appx files. So the procedure is to extract the correct Appx, then extract the actual required files from it. For the Ubuntu 20.04 case (as Kumori123 asked), it would be

CanonicalGroupLimited.UbuntuonWindows_2004.2021.825.0.AppxBundle
↓
Ubuntu_2004.2021.825.0_x64.appx
↓
install.tar.gz and ubuntu.exe

The AppxBundle and Appx is just ZIP file. Use any tool as you want. Extract install.tar.gz and ubuntu.exe in any folder. Double click on ubuntu.exe and the rest will be as usual.

Why not extract the entire content?

image

Why just install.tar.gz and ubuntu.exe?

@Biswa96
Copy link

Biswa96 commented Jan 4, 2023

May I get some references on the issues that you are talking about?

I can not recall the exact link of those issues. But the gist of it is that - the UWP packages run with different system user and permission. Changing that user permission of WindowsApps directory may break the entire UWP stack.

Why not extract the entire content?
Why just install.tar.gz and ubuntu.exe?

Because you do not need other files just to install the distribution. I have tested with Ubuntu 20.04 as kumori123 asked. Other distributions may require different files. Feel free to extract all the files as suggested here https://learn.microsoft.com/en-us/windows/wsl/install-on-server

@bwgjoseph
Copy link

bwgjoseph commented Jan 4, 2023

Thanks, learned something new today.

@ilingleb117
Copy link
Author

And why wouldn't microsoft publish a complete package for offline deployment? AMD drivers, Windows Terminal, images with embedded applications (for example SW_DVD5_NTRL_Win_10_1709_32_64_ARM64_MultiLang_App_Update_X21-50436.ISO ) and many other packages include license files. You can conduct an experiment. Install Windows 10 into a virtual machine without internet enabled. Transfer the Windows Terminal to the machine.App and WindowsTerminal.xml . Scenario one: you install the package properly via DISM (including the license file /LicensePath:), the result is: the application starts. Scenario two: you installed Windows Terminal without a license file (/SkipLicense), the result: the application does not start. Scenario three: you also install the application without a license file, provide Internet access to the machine, the result: the application works. In this case, after disconnecting the Internet, the application will continue to work

If someone has access to Microsoft Store for Business or Microsoft Store for Education, then please generate license files. It seems to me that we will not wait for the full package from microsoft and we will see a crutch solution in the form of manual unpacking of archives.

@kumori123
Copy link

Thank you all!

@eur2fe
Copy link

eur2fe commented Mar 6, 2023

Came here looking for a license file for the Ubuntu apps.

Just in case anybody is looking for an offline installation, using the cmdlet Add-AppxPackage will install the package, but you will not be able to run it as the app does not have a license yet (you'll get an error in the event log). For an offline install, you need to use Add-AppxProvisionedPackage -Online and provide the package and the offline license file.

So, the issue here is that we are in need of the proper offline license files, just like the Windows Terminal guys did in their PreinstallKit.zip.

@yadanchina
Copy link

May I ask how this was resolved in the end? I did not find an offline license on the network.

@ilingleb117
Copy link
Author

May I ask how this was resolved in the end? I did not find an offline license on the network.

Yes. I have few workarounds for offline installation. One of them:

  1. Download appx bundle linux distribituon. For example Ubuntu2204-221101.AppxBundle
  2. Turn on Dev Mode in Windows setttings
  3. Unpack Ubuntu2204-221101.AppxBundle to C:\WSL\UbuntuBundle (for example)
  4. In C:\WSL\UbuntuBundle unpack Ubuntu_2204.1.7.0_x64.appx to C:\WSL\UbuntuBundle\x64 (for example)
  5. Delete file C:\WSL\UbuntuBundle\x64\AppxSignature.p7x
  6. Run PowerShell
  7. Run Add-AppxPackage -Register "C:\WSL\UbuntuBundle\x64\AppxManifest.xml"
  8. Run installed app from start
  9. ???
  10. PROFIT

@yadanchina
Copy link

Thank you very much. This method is very effective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants