'dotnet workload install' command doesn't work on LXC container when login as ubuntu user

Bug #2018308 reported by Miriam España Acebal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dotnet6 (Ubuntu)
New
Undecided
Unassigned

Bug Description

This was reported upstream (https://github.com/dotnet/sdk/issues/31685). It could also affect dotnet7.

We narrowed it to the LXC containers when login as user scenario, which applies to whatever situation where we have SUDO_UID set (https://github.com/dotnet/sdk/issues/31685#issuecomment-1521593636). I'm filling this out for awareness here.

The issue is that no workloads are listed after a successful installation:

#Installation

ubuntu@dotnetJ:~$ dotnet workload install wasm-tools

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------

Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.workload.emscripten.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...
Garbage collecting for SDK feature band(s) 6.0.100...

Successfully installed workload(s) wasm-tools.

#Checking

ubuntu@dotnetJ:~$ sudo dotnet workload list

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.116

----------------
[...]
--------------------------------------------------------------------------------------

Installed Workload Ids
----------------------

Use `dotnet workload search` to find additional workloads to install.

The steps to reproduce are the following:

# Install lxd (https://linuxcontainers.org/lxd/getting-started-cli/)
In Ubuntu: sudo snap install lxd
In Fedora: dnf copr enable ganto/lxc4
           dnf install lxd
Windows: choco install lxc (previously installing Chocolatey)

# Configuring LXD (https://linuxcontainers.org/lxd/docs/latest/howto/initialize/)
lxd init #(interactive)
or
lxd init --minimal #(for a quick test)

# Creating the container
lxc launch --vm ubuntu-daily:jammy Jdotnet #(you can choose another name instead of Jdotnet)

# Login
lxc exec Jdotnet -- sudo --login --user ubuntu

# checking HOME (it should be /home/ubuntu)
env | grep HOME

# Installing dotnet6
sudo apt update
sudo apt install -y dotnet6

# The specific issue in #31685
dotnet workload install wasm-tools
dotnet workload list

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.