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

Amazon2.exe config --default-user user returns ERROR HRESULT:0x80004005 #14

Closed
sobil opened this issue Nov 11, 2021 · 2 comments
Closed

Comments

@sobil
Copy link
Contributor

sobil commented Nov 11, 2021

Description

Cannot set Default user.

While trying to setup AL2 in WSL i recieve this error if setting the default user.:

ERROR HRESULT:0x80004005

Repro Steps

$1 = Start-Job -ScriptBlock {wsl --install}
$2 = Start-Job -ScriptBlock {
  Invoke-WebRequest -Uri https://github.com/yosukes-dev/AmazonWSL/releases/download/2.0.20210721.2/Amazon2.zip -OutFile $env:TMP\Amazon2.zip
  Expand-Archive -Path $env:TMP\Amazon2.zip -DestinationPath C:\WSL\Amazon2
}
Wait-Job -Job $1,$2
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --update
Restart-Computer

After Reboot

PS C:\WSL\Amazon2> .\Amazon2.exe
PS C:\WSL\Amazon2> .\Amazon2.exe config --default-user user
ERROR
HRESULT:0x80004005
Press any key to continue...

Environement Details

PS C:\WSL\Amazon2> wsl --status
Default Distribution: Amazon2
Default Version: 2

Windows Subsystem for Linux was last updated on 26/10/2021
The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings.
To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'.
For more information please visit https://aka.ms/wsl2kernel.

Kernel version: 5.10.16
PS C:\WSL\Amazon2> systeminfo

Host Name:                 <redacted>-18
OS Name:                   Microsoft Windows 10 Enterprise for Virtual Desktops
OS Version:                10.0.19042 N/A Build 19042
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Server
OS Build Type:             Multiprocessor Free
Registered Owner:          N/A
Registered Organization:   N/A
Product ID:                00432-70000-00001-AA833
Original Install Date:     18/10/2021, 3:31:33 PM
System Boot Time:          11/11/2021, 10:32:44 AM
System Manufacturer:       Microsoft Corporation
System Model:              Virtual Machine
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 85 Stepping 7 GenuineIntel ~2594 Mhz
BIOS Version:              American Megatrends Inc. 090008 , 7/12/2018
Windows Directory:         C:\windows
System Directory:          C:\windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC+10:00) Canberra, Melbourne, Sydney
Total Physical Memory:     8,192 MB
Available Physical Memory: 3,880 MB
Virtual Memory: Max Size:  9,472 MB
Virtual Memory: Available: 4,882 MB
Virtual Memory: In Use:    4,590 MB
Page File Location(s):     D:\pagefile.sys
Domain:                    core.domain.net.au
Logon Server:              \\<redacted>
Hotfix(s):                 9 Hotfix(s) Installed.
                           [01]: KB5005539
                           [02]: KB4562830
                           [03]: KB4577266
                           [04]: KB4577586
                           [05]: KB4580325
                           [06]: KB4589212
                           [07]: KB5007186
                           [08]: KB5006753
                           [09]: KB5005699
Network Card(s):           2 NIC(s) Installed.
                           [01]: Microsoft Hyper-V Network Adapter
                                 Connection Name: Ethernet 2
                                 DHCP Enabled:    Yes
                                 DHCP Server:     <redacted>
                                 IP address(es)
                                 [01]: <redacted>
                                 [02]: <redacted>
                           [02]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (WSL)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: <redacted>
                                 [02]: <redacted>
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.
PS C:\WSL\Amazon2>
@yosukes-dev
Copy link
Owner

PS C:\WSL\Amazon2> .\Amazon2.exe config --default-user user

Does a user named "user" exist?
To specify a default user, the user must exist.

If it is not created, you can run the following command after rebooting to solve the problem

PS C:\WSL\Amazon2> .\Amazon2.exe
Using: C:\WSL\Amazon2\rootfs.tar.gz
Installing...
Installation complete
Press enter to continue...

PS C:\WSL\Amazon2> .\Amazon2.exe run useradd -m -g users -G wheel -s /bin/bash user
PS C:\WSL\Amazon2> .\Amazon2.exe config --default-user user
PS C:\WSL\Amazon2> .\Amazon2.exe
[user@DESKTOP-NOBTN9F Amazon2]$

@sobil
Copy link
Contributor Author

sobil commented Nov 15, 2021

Thanks heaps. that did the trick for me.

https://github.com/yosukes-dev/AmazonWSL/pull/15/files

Feel free to close the PR if you think it's not something you dont want to add. It definately would have helped me FWIW.

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

No branches or pull requests

2 participants