Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Use Podman Desktop in Visual Studio 2022 Container Tools for .NET Core 8 Containerized Development and Debugging?

Question:

I'm trying to use Podman Desktop in Visual Studio 2022's Container Tools for containerized development and debugging of a .NET Core 8 project, but I'm facing some inconsistent issues. Here are the two approaches I've tried so far and the results:

Approach 1 (Higher success rate but still unstable):

  1. Install Docker Desktop and run it to generate %appdata%\Roaming\Docker\settings.json, then close Docker Desktop.
  2. Install Podman Desktop, followed by installing Podman machine.
  3. Add an environment variable DOCKER_HOST and set it to npipe:////./pipe/podman-machine-default.
  4. Restart the system, then run Podman Desktop to ensure the Podman machine is running.
  5. Compile the .NET 8 project using Visual Studio 2022's Container Tools.

Result: Sometimes the debugging works, but other times it fails when build image with unclear error messages Unabled to find image 'webapplication:dev' locally docker: Error response from daemon {"message":"denied: requested access to the resource is denied"}. or WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load

Additional Observations:

  • Docker compose can work.
  • When debugging fails, I've noticed high memory usage in WSL.
  • Multiple docker.exe processes are running in the background.
  • Running docker version directly results in no response.

Approach 2 (Able to build the image but debugging fails):

  1. Install Podman Desktop, followed by installing Podman machine.
  2. Create a docker.bat script to substitute Docker commands with Podman commands and add it to the PATH environment variable.
  3. Restart the system, then run Podman Desktop to ensure the Podman machine is running.
  4. Compile the .NET 8 project using Visual Studio 2022's Container Tools.

Result:

  • Able to successfully build the image from the Dockerfile and debug, but container tool unabled to use.
  • Docker Compose cannot be used.

My Questions: Has anyone successfully used Podman Desktop in Visual Studio 2022 Container Tools for debugging a .NET Core 8 project?

If so, could you share your configuration and steps?

Are there any recommendations to improve the stability of Approach 1 or resolve the debugging issues in Approach 2?

Thank you very much!

like image 414
littletree71 Avatar asked Oct 29 '25 00:10

littletree71


1 Answers

There is another approach to getting podman desktop working with both VS2022 and VSCode. There is no need for environment variables or a specific order of install.

winget install RedHat.Podman-Desktop
winget install Docker.DockerCLI

Run podman desktop which will prompt you to install / setup podman. By default, podman machine should redirect api calls to the standard docker api socket so that any docker client should work with podman (including DockerCLI). Having the official docker CLI installed is enough to make VS and VSCode attempt to interact with the docker socket and everything should just work.

Just to be clear, this assumes you do not have docker desktop (or any any other variant of docker or any other container engine) installed at the time you install podman desktop

like image 156
Michael Melancon Avatar answered Nov 01 '25 06:11

Michael Melancon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!