Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

.NET on Linux: Which Environment?

May 17, 2016
Don Schenck
Related topics:
.NETLinux
Related products:
Red Hat Enterprise Linux

Share:

    If you are a Windows developer and you want to start writing .NET code in Linux, and you're not sure where to start, this article should help you understand some of the choices regarding your development environment.

    I’ll be using the Red Hat Enterprise Linux Developer Suite (RHEL) as my Linux of choice, which is freely downloadable for development use. It's also worth mentioning that how you actually install RHEL will affect your development experience. The up-front work to get a full-blown, GUI-based version of RHEL running is, I believe, worth the payoff later. However, you may choose to get up and running quickly in a command line environment and defer the GUI work until later.

    Some of your choices include:

    • Run RHEL on bare metal. That is, install it directly onto a PC. You can choose this option and run with or without a graphical interface (such as Gnome).
    • Run RHEL locally using a hypervisor/virtual machine (Hyper-V, VirtualBox, VMware) on your Windows environment. This requires that your version of Windows supports virtualization (e.g. Windows 10 Professional). You can choose this and run without a GUI. Alternatively, you can install a GUI, which is what I recommend -- more about that later.
    • Finally, you could use a cloud-based VM running RHEL (Typically no GUI).

    RHEL on Bare Metal

    If you choose to install RHEL on bare metal, you're most likely going to want to use Gnome for a GUI. That will allow you to also run Visual Studio Code (VSCode) - Microsoft's free code editor (based on Electron). This option offers the best performance, but it does mean you need a physical machine. This configuration basically involves installing RHEL from the ISO file and going from there. In this scenario, you're living and working in Linux. You can edit and debug your code from within the IDE (VSCode) and you won't need to install a lot of supporting software - pretty much everything you need will be in one place: inside RHEL. You may, however, end up lugging around two notebooks PCs, or setting up a "dual boot" environment on your single machine.

    RHEL in a Virtual Machine

    Running a Virtual Machine (VM), whether on you are on a local PC or in the cloud, gives you the option of choosing between a command line or a GUI. It also means you can leave your Windows PC alone. You can run RHEL simply as a console (i.e. you open a bash shell terminal on your Windows PC), or as a desktop, using VNC to connect. Let's explore these two options a little.

    Headless (No GUI)

    Running RHEL without a GUI ("headless") means you'll need a bash shell on your Windows machine. Microsoft has made this available now (it's a beta), or you can use a third party solution such as Cygwin. This isn't a bad thing, because you can start to use the bash shell for all your command-line operations, even against  your Windows file system. You benefit in that you learn bash and use it everywhere.

    Running headless also means you'll probably edit your code on your Windows PC and then either save then in a folder that is shared between the host and the VM. You can also use a git repositoryto push code from your Windows PC and pull from the VM via the bash command line. Lastly, as I explain in a recent blog post, you can set up direct filesystem sharing using Samba (this is the most work to set up, but the least work go use). The biggest limitation? You won't be able to debug your code from within VSCode. That's a big deal if you ask me. In fact, I consider it a show-stopper. (And I'll explain how to get that working in a future blog post.)

    With GUI

    Running RHEL with a GUI, especially in a VM on your local Windows PC, is a full-feature environment. You use one PC. You keep Windows. Best of all, you can run VSCode on Linux, which means you can debug your code from within your IDE. You can set breakpoints, inspect variables, see the stack trace ... everything you need for a full-featured interactive debugging session. There are some considerations, however.

    If you're using Hyper-V, you'll likely want to install the VNC server on your RHEL VM, and install the corresponding VNC client on Windows. This is due to the fact that changing screen resolutions on Hyper-V can prove difficult or impossible. (This issue does not occur with some of the other VM technologies listed above.)

    I use TightVNC on Windows, and it works very well. You'll also want to use Cygwin to SSH into your VM and run common commands from the command line. For example, yeoman and Autorest are both command line tools that you'll probably want to use.

    For me, being able to summon my RHEL environment with a few mouse clicks and enjoy the rich, feature-laden experience of coding and debugging from the IDE makes this the best option.

    Conclusion

    No matter which environment you choose, you'll be well on your way to creating .NET code that can almost anywhere, including Linux. Get started now by downloading your developer's copy of RHEL and setting up your environment.

    Additional Resources:

    .NET on RHEL Webinar (video)

    Red Hat Enterprise Linux Developer Suite

    Linux commands cheat sheet

    Red Hat Developer's site for .NET

    Visual Studio Code

    Cywin bash shell for Windows

    TightVNC for Windows

    Microsoft's .NET site

    For additional information and articles on .NET Core visit our .NET Core web page for more on this topic.

     

    Last updated: March 15, 2023

    Recent Posts

    • GuideLLM: Evaluate LLM deployments for real-world inference

    • Unleashing multimodal magic with RamaLama

    • Integrate Red Hat AI Inference Server & LangChain in agentic workflows

    • Streamline multi-cloud operations with Ansible and ServiceNow

    • Automate dynamic application security testing with RapiDAST

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue