Giter VIP home page Giter VIP logo

amazonwsl's Introduction

Hi there ๐Ÿ‘‹๐Ÿฐ๐Ÿฅ•


โšก Technologies

Linux Windows WSL Powershell Go C++ C# Java Nodejs Yarn Angular Redux JavaScript TypeScript HTML5 CSS3 Sass Bootstrap MongoDB Redis ElasticSearch Oracle PostgreSQL MySQL Heroku Docker Kubernetes Amazon AWS Microsoft Azure Google Cloud Firebase Git SVN GitHub GitLab BitBucket Azure DevOps Azure Pipelines CircleCI CodeCov Cloudflare VSCode

๐Ÿ“Š My stats

yosukes-dev

yosukes-dev

amazonwsl's People

Contributors

sobil avatar wynnw avatar yosukes-dev avatar yuk7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazonwsl's Issues

Icon for Windows Terminal

For the next release, maybe include the below PNG as an AWS-icon.png file. That way it could easily be added to the Windows Terminal profile.

AWS-icon

Here's also an example for the Windows Profile itself.

{
    "guid": "{3dffc929-1f2e-44cc-8253-9635e0298f6b}",
    "hidden": false,
    "name": "Amazon Linux 2",
    "commandline": "wsl.exe -d Amazon2",
    "startingDirectory" : "C:\\",
    "icon": "C:\\Amazon2\\AWS-icon.png"
}

Increase the size of ext4.vdhx

Hi, when I run Amazon2.exe I only get 500MB whereas in ubuntu I can have 180GB .vhdx size. Is there any way to resize it?

AMI 2023 released

Hi,

Looks like AMI 2023 was released and 2022 never made it out of preview. Can you update to 2023?

Thanks,
Chuck

Service command not found

When I run command service docker start
The console says -bash: service: command not found

How do I run service command?

I tried to search service binary to /usr/sbin, /sbin, /usr/bin, etc...
But I can't find the service binary anywhere.

Determine correct version of Distro

I followed the instructions and Amazon2 is the default

PS C:\WINDOWS\system32> wsl -l
Windows Subsystem for Linux Distributions:
Amazon2 (Default)

So to check the version, I used:

PS C:\WINDOWS\system32> wsl
-bash-4.2# uname -srm
Linux 4.4.0-18362-Microsoft x86_64
-bash-4.2#

Is this version correct for Amazon Linux?

Thanks

Service cmd doesn't load

-bash-4.2# systemctl
Failed to get D-Bus connection: Operation not permitted

-bash-4.2# service
-bash: service: command not found

Amazon2.exe corrupt (not a PE binary)

just downloaded the release 2.0.20210721.2 and foudn that the Amazon2.exe is broken.
I've used the previous release one to finish the installation.

Gabriele

wsl2 networking issue requires static ipaddr and route workaround

Due to a known wsl2 networking issue, some users need to create a static ip and route to establish internet access.
microsoft/WSL#4275

to fix on Ubuntu the steps are

/etc/wsl.conf
[network]
generateResolvConf = false

/etc/resolv.conf
nameserver 8.8.8.8

~/.bashrc
ip addr flush dev eth0
ip addr add 192.168.0.xxx/24 dev eth0
ip route add default via 192.168.0.1

to match this on this distro I manually verified with

/etc/wsl.conf
[network]
generateResolvConf = false

/etc/resolv.conf
nameserver 8.8.8.8

$
ip addr flush dev eth0
ip addr add 192.168.0.117/24 dev eth0
ip route add default via 192.168.0.1

this returns for ip addr // route

4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:57:9c:3d brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.117/24 scope global eth0
       valid_lft forever preferred_lft forever

default via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.117

and works as expected to access internet.

trying to automate it, I updated
/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
IPADDR=19.168.0.117
PREFIX=24
GATEWAY=192.168.0.1
ONBOOT=yes
DNS1=192.168.0.1
DNS2=8.8.8.8
DNS3=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=eth0
UUID= //from $uuidgen eth0//

wsl --shutdown
restart but ip addr still returns

4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:57:9c:3d brd ff:ff:ff:ff:ff:ff
    inet 172.23.5.215/20 brd 172.23.15.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe57:9c3d/64 scope link
       valid_lft forever preferred_lft forever


ip route
default via 172.23.0.1 dev eth0
172.23.0.0/20 dev eth0 proto kernel scope link src 172.23.5.215

so tried adding to .bash rc

cp /etc/skel/.bashrc ~/.bashrc
$
ip addr flush dev eth0
ip addr add 192.168.0.117/24 dev eth0
ip route add default via 192.168.0.1

source ~/.bashrc

is there a way to automate the static IP addr and route at wsl2 launch?

AL2 / WSL2 time issue.

I'm finding that i cant' keep my WSL image time synced... ntp and chronyd both fail

bash-4.2# sudo service chronyd start
Redirecting to /bin/systemctl start chronyd.service
Failed to get D-Bus connection: Operation not permitted

The temp fix, was to update it manually.

bash-4.2# sudo ntpdate pool.ntp.org
5 Sep 10:49:17 ntpdate[5592]: step time server 43.252.70.34 offset 3455.750697 sec

This was affecting my ability to connect to AWS with temporary credentials as the time was sufficently wrong that it would not stay in sync.

It appears that if i shut down my machine, the wsl machine clock actually stops, were as the host machine's clock does'nt, and it restarts from where it started off.

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

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>

More documentation after installing Amazon2

I try to run the command after installing that mentioned in README.md.

When I run .\Amazon2.exe config --default-user rizary, I got the following error:

ERROR
HRESULT:0x80004005
Press any key to continue...

It's a fresh install. Do I need to run it as root first and then adding the user there? Or users are automatically added like any other WSL2 distro?

Empty mount drive

I noticed that the host mount drive, while present, is empty. For example, the following command prints an empty folder.

Amazon2.exe run ls -al /mnt/c/

The same command works fine with the CentOS7 image:

CentOS7.exe run ls -al /mnt/c/

Is there a workaround to make this work on Amazon Linux as well?

Using aws-cli

When I run aws in AmazonWSL bash, it doesn't seem to do anything.

e.g. aws --version
simply returns to the bash prompt.

I also tried yum install aws-cli which did the install but aws still does not do anything.

-bash-4.2# yum install aws-cli
Loaded plugins: ovl, priorities
amzn2-core | 2.4 kB 00:00:00
Package awscli-1.16.300-1.amzn2.0.1.noarch already installed and latest version
Nothing to do

How do I get aws-cli working?

-bash-4.2# aws --version
-bash-4.2#

Cannot find a valid baseurl for repo: amzn2-core/2/x86_64

-bash-4.2# yum update -y
Loaded plugins: ovl, priorities
Could not retrieve mirrorlist https://amazonlinux.default.amazonlinux.com/2/core/latest/x86_64/mirror.list error was
12: Timeout on https://amazonlinux.default.amazonlinux.com/2/core/latest/x86_64/mirror.list: (28, 'Resolving timed out after 5001 milliseconds')

One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: amzn2-core/2/x86_64

Some basic packages are missing

Some basic packages not available .

I would like if basic commands are added by default. Packages like:

  • tar
  • git
  • find
  • which
    and more often used cmd.

If you could provide how to build this package from scratch. I'd really appreciate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.