Raspbian support #447

Closed
TVoc opened this Issue Jan 24, 2017 · 54 comments

Comments

Projects
None yet
@TVoc

TVoc commented Jan 24, 2017

I am waiting for a working build of dotnet for the Raspberry Pi. Currently, this page links to builds targeted to Ubuntu, but my Raspberry Pi is running Raspbian and installing Ubuntu specifically for this would be a major inconvenience. I would therefore like to know if there are plans to support Raspbian in the future.

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc Jan 27, 2017

As an addendum, when I run dotnet.bootstrap.py as outlined here, this is the result:

pi@raspberrypi:~/src/core/tools/dotnet-bootstrap $ ./dotnet.bootstrap.py
** ROVER Building: ['coreclr', 'corefx', 'core-setup', 'libuv']
** ROVER Patching? True
** ROVER Staging in raspbian.8-x64-dotnet
** ROVER RID: raspbian.8-x64
** ROVER is downloading latest .NET CLI for bootstrapping (dotnet.latest.tar.gz)
** ROVER CAUGHT AN UNEXPECTED EXCEPTION: "SemanticVersion instance has no attribute 'find'" of type: <type 'exceptions.AttributeError'>
  File "./dotnet.bootstrap.py", line 545, in <module>
    SpawnPatchTarget(RoverSettings._binDirectory, RoverSettings.PayloadPath)
  File "./dotnet.bootstrap.py", line 342, in SpawnPatchTarget
    RoverSettings.SetPatchTargetPath(path.join(RoverSettings._ScriptDirectory, destination_folder))
  File "./dotnet.bootstrap.py", line 261, in SetPatchTargetPath
    RoverSettings.PatchTarget_Shared   = path.join(shared_containerFolder, RoverSettings.SelectGreatestPrecendenceDirectory(shared_containerFolder))
  File "./dotnet.bootstrap.py", line 248, in SelectGreatestPrecendenceDirectory
    maxVersion = RoverSettings.MaxPrecedence(dirName, maxVersion)
  File "./dotnet.bootstrap.py", line 234, in MaxPrecedence
    versionB = SemanticVersion(versionStrB)
  File "./dotnet.bootstrap.py", line 156, in __init__
    self.VersionTuple = self.GetVersionTuple(versionStr)
  File "./dotnet.bootstrap.py", line 141, in GetVersionTuple
    middleIndex = versionStr.find('-')
** ROVER None

TVoc commented Jan 27, 2017

As an addendum, when I run dotnet.bootstrap.py as outlined here, this is the result:

pi@raspberrypi:~/src/core/tools/dotnet-bootstrap $ ./dotnet.bootstrap.py
** ROVER Building: ['coreclr', 'corefx', 'core-setup', 'libuv']
** ROVER Patching? True
** ROVER Staging in raspbian.8-x64-dotnet
** ROVER RID: raspbian.8-x64
** ROVER is downloading latest .NET CLI for bootstrapping (dotnet.latest.tar.gz)
** ROVER CAUGHT AN UNEXPECTED EXCEPTION: "SemanticVersion instance has no attribute 'find'" of type: <type 'exceptions.AttributeError'>
  File "./dotnet.bootstrap.py", line 545, in <module>
    SpawnPatchTarget(RoverSettings._binDirectory, RoverSettings.PayloadPath)
  File "./dotnet.bootstrap.py", line 342, in SpawnPatchTarget
    RoverSettings.SetPatchTargetPath(path.join(RoverSettings._ScriptDirectory, destination_folder))
  File "./dotnet.bootstrap.py", line 261, in SetPatchTargetPath
    RoverSettings.PatchTarget_Shared   = path.join(shared_containerFolder, RoverSettings.SelectGreatestPrecendenceDirectory(shared_containerFolder))
  File "./dotnet.bootstrap.py", line 248, in SelectGreatestPrecendenceDirectory
    maxVersion = RoverSettings.MaxPrecedence(dirName, maxVersion)
  File "./dotnet.bootstrap.py", line 234, in MaxPrecedence
    versionB = SemanticVersion(versionStrB)
  File "./dotnet.bootstrap.py", line 156, in __init__
    self.VersionTuple = self.GetVersionTuple(versionStr)
  File "./dotnet.bootstrap.py", line 141, in GetVersionTuple
    middleIndex = versionStr.find('-')
** ROVER None
@perlun

This comment has been minimized.

Show comment
Hide comment
@perlun

perlun Jan 28, 2017

Contributor

This would be very, very nice! .NET core is already a great piece of software, being able to use it on my Raspberry Pi(s) would be even greater. Raspbian is a much more natural and popular choice there, so adding support for it should be considered.

Contributor

perlun commented Jan 28, 2017

This would be very, very nice! .NET core is already a great piece of software, being able to use it on my Raspberry Pi(s) would be even greater. Raspbian is a much more natural and popular choice there, so adding support for it should be considered.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Feb 1, 2017

Member

So far, we've only built in on Ubuntu and it worked great on a Raspberry Pi. I expect we will shortly be able to have something that will work on Raspian too.

Member

Petermarcu commented Feb 1, 2017

So far, we've only built in on Ubuntu and it worked great on a Raspberry Pi. I expect we will shortly be able to have something that will work on Raspian too.

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc Feb 27, 2017

I compiled it on my Raspberry Pi, but there were some things I did differently:

  • edited dotnet.bootstrap.py as follows:
diff --git a/tools/dotnet-bootstrap/dotnet.bootstrap.py b/tools/dotnet-bootstrap/dotnet.bootstrap.py
index 92749bc..1093c40 100755
--- a/tools/dotnet-bootstrap/dotnet.bootstrap.py
+++ b/tools/dotnet-bootstrap/dotnet.bootstrap.py
@@ -382,21 +382,22 @@ def BuildNativeComponents(  coreclr_git_directory,
         # Build CoreCLR
         # skipping non-essential for bootstrapping.
         if 'coreclr' in RoverSettings.BuildSet:
-            RoverShellCall('./build.sh x64 release skiptests skipnuget', cwd=coreclr_git_directory)
+            #RoverShellCall('./build.sh x64 release skiptests skipnuget', cwd=coreclr_git_directory)
+            RoverShellCall('./build.sh arm release skiptests skipnuget skipmscorlib clang3.7', cwd=coreclr_git_directory)
 
         # Build CoreFX Native Pieces
         if 'corefx' in RoverSettings.BuildSet:
             # at different points in the history of CoreFX there have been differing build behaviors, these conditionals
             # cover that. However, if we find these differences, we will need to adapt.s
             if path.exists(path.join(corefx_git_directory, 'src', 'Native', 'build-native.sh')):
-                RoverShellCall('./build-native.sh x64 release Linux --numProc 1', cwd="%s/src/Native"%(corefx_git_directory))
+                RoverShellCall('./build-native.sh arm release Linux --numProc 1', cwd="%s/src/Native"%(corefx_git_directory))
             else:
-                RoverShellCall('./build.sh native x64 release', cwd=corefx_git_directory) 
+                RoverShellCall('./build.sh native arm release', cwd=corefx_git_directory) 
 
         # Build corehost from core-setup
         # TODO: Pull versions from the runtimes.
         if 'core-setup' in RoverSettings.BuildSet:
-            RoverShellCall('./build.sh --arch x64 --rid %s --hostver 0.0.0 --fxrver 0.0.0 --policyver 0.0.0 --commithash %s'%(RoverSettings._Rid, RoverSettings.DotNetCommitHash), cwd="%s/src/corehost"%(core_setup_git_directory))
+            RoverShellCall('./build.sh --arch arm --rid %s --hostver 0.0.0 --fxrver 0.0.0 --policyver 0.0.0 --commithash %s'%(RoverSettings._Rid, RoverSettings.DotNetCommitHash), cwd="%s/src/corehost"%(core_setup_git_directory))
 
         # Build libUV
         if 'libuv' in RoverSettings.BuildSet:
@@ -502,8 +503,8 @@ if __name__ == "__main__":
     core_setup_working_git_directory    = path.join(RoverSettings._srcDirectory, 'core-setup')
     libuv_working_git_directory         = path.join(RoverSettings._srcDirectory, 'libuv')
 
-    default_coreclr_bin_directory       = '%s/bin/Product/Linux.x64.Release/'%(coreclr_working_git_directory)
-    default_corefx_native_bin_directory = '%s/bin/Linux.x64.Release/Native'%(corefx_working_git_directory)
+    default_coreclr_bin_directory       = '%s/bin/Product/Linux.arm.Release/'%(coreclr_working_git_directory)
+    default_corefx_native_bin_directory = '%s/bin/Linux.arm.Release/Native'%(corefx_working_git_directory)
     default_core_setup_cli_bin_directory= '%s/src/corehost/cli'%(core_setup_working_git_directory)
     default_libuv_bin_directory         = '%s/.libs'%(libuv_working_git_directory)
  • edited build files for CoreCLR to support clang 3.7/lldb 3.7, like here
  • downloaded latest release for Debian (from here) to use as payload
  • ran dotnet.bootstrap.py with ./dotnet.bootstrap.py -b coreclr corefx core-setup libuv -payload dotnet.tar.gz (with dotnet.tar.gz the archive I mentioned in the previous step)

When I run ./dotnet --version in /core/tools/dotnet-bootstrap/raspbian.8-x64-dotnet/bin, the result is Failed to initialize CoreCLR, HRESULT: 0x80004005

Does anyone have an idea of what I did wrong?

TVoc commented Feb 27, 2017

I compiled it on my Raspberry Pi, but there were some things I did differently:

  • edited dotnet.bootstrap.py as follows:
diff --git a/tools/dotnet-bootstrap/dotnet.bootstrap.py b/tools/dotnet-bootstrap/dotnet.bootstrap.py
index 92749bc..1093c40 100755
--- a/tools/dotnet-bootstrap/dotnet.bootstrap.py
+++ b/tools/dotnet-bootstrap/dotnet.bootstrap.py
@@ -382,21 +382,22 @@ def BuildNativeComponents(  coreclr_git_directory,
         # Build CoreCLR
         # skipping non-essential for bootstrapping.
         if 'coreclr' in RoverSettings.BuildSet:
-            RoverShellCall('./build.sh x64 release skiptests skipnuget', cwd=coreclr_git_directory)
+            #RoverShellCall('./build.sh x64 release skiptests skipnuget', cwd=coreclr_git_directory)
+            RoverShellCall('./build.sh arm release skiptests skipnuget skipmscorlib clang3.7', cwd=coreclr_git_directory)
 
         # Build CoreFX Native Pieces
         if 'corefx' in RoverSettings.BuildSet:
             # at different points in the history of CoreFX there have been differing build behaviors, these conditionals
             # cover that. However, if we find these differences, we will need to adapt.s
             if path.exists(path.join(corefx_git_directory, 'src', 'Native', 'build-native.sh')):
-                RoverShellCall('./build-native.sh x64 release Linux --numProc 1', cwd="%s/src/Native"%(corefx_git_directory))
+                RoverShellCall('./build-native.sh arm release Linux --numProc 1', cwd="%s/src/Native"%(corefx_git_directory))
             else:
-                RoverShellCall('./build.sh native x64 release', cwd=corefx_git_directory) 
+                RoverShellCall('./build.sh native arm release', cwd=corefx_git_directory) 
 
         # Build corehost from core-setup
         # TODO: Pull versions from the runtimes.
         if 'core-setup' in RoverSettings.BuildSet:
-            RoverShellCall('./build.sh --arch x64 --rid %s --hostver 0.0.0 --fxrver 0.0.0 --policyver 0.0.0 --commithash %s'%(RoverSettings._Rid, RoverSettings.DotNetCommitHash), cwd="%s/src/corehost"%(core_setup_git_directory))
+            RoverShellCall('./build.sh --arch arm --rid %s --hostver 0.0.0 --fxrver 0.0.0 --policyver 0.0.0 --commithash %s'%(RoverSettings._Rid, RoverSettings.DotNetCommitHash), cwd="%s/src/corehost"%(core_setup_git_directory))
 
         # Build libUV
         if 'libuv' in RoverSettings.BuildSet:
@@ -502,8 +503,8 @@ if __name__ == "__main__":
     core_setup_working_git_directory    = path.join(RoverSettings._srcDirectory, 'core-setup')
     libuv_working_git_directory         = path.join(RoverSettings._srcDirectory, 'libuv')
 
-    default_coreclr_bin_directory       = '%s/bin/Product/Linux.x64.Release/'%(coreclr_working_git_directory)
-    default_corefx_native_bin_directory = '%s/bin/Linux.x64.Release/Native'%(corefx_working_git_directory)
+    default_coreclr_bin_directory       = '%s/bin/Product/Linux.arm.Release/'%(coreclr_working_git_directory)
+    default_corefx_native_bin_directory = '%s/bin/Linux.arm.Release/Native'%(corefx_working_git_directory)
     default_core_setup_cli_bin_directory= '%s/src/corehost/cli'%(core_setup_working_git_directory)
     default_libuv_bin_directory         = '%s/.libs'%(libuv_working_git_directory)
  • edited build files for CoreCLR to support clang 3.7/lldb 3.7, like here
  • downloaded latest release for Debian (from here) to use as payload
  • ran dotnet.bootstrap.py with ./dotnet.bootstrap.py -b coreclr corefx core-setup libuv -payload dotnet.tar.gz (with dotnet.tar.gz the archive I mentioned in the previous step)

When I run ./dotnet --version in /core/tools/dotnet-bootstrap/raspbian.8-x64-dotnet/bin, the result is Failed to initialize CoreCLR, HRESULT: 0x80004005

Does anyone have an idea of what I did wrong?

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Mar 7, 2017

Member

We're going to be changing some things such that we build linux binaries for ARM that will work on many different distros. That will address this.

Member

Petermarcu commented Mar 7, 2017

We're going to be changing some things such that we build linux binaries for ARM that will work on many different distros. That will address this.

@Lewiscowles1986

This comment has been minimized.

Show comment
Hide comment
@Lewiscowles1986

Lewiscowles1986 Mar 13, 2017

Does anyone know if this could work in a dockerised ubuntu on raspbian? Build the container, send to dockerhub, cuts down drastically on the commands needed to run.

Does anyone know if this could work in a dockerised ubuntu on raspbian? Build the container, send to dockerhub, cuts down drastically on the commands needed to run.

@yappy yappy referenced this issue in yappy/DollsKit Mar 14, 2017

Open

.NET Core 対応 #27

@moozoo64

This comment has been minimized.

Show comment
Hide comment
@moozoo64

moozoo64 Mar 21, 2017

I just wanted to add that there are 11+ million raspberry pi's sold. Most of which will be running Raspbian.
"The Raspberry Pi Foundation sells about 350,000 to 400,000 units a month"
From http://www.belfasttelegraph.co.uk/business/news/raspberry-pi-sales-hit-11-million-and-could-overtake-commodore-64-35245709.html

I'd also like to see dotnet core support aarch64 (suse, debian stretch) on the raspberry pi 3+

I just wanted to add that there are 11+ million raspberry pi's sold. Most of which will be running Raspbian.
"The Raspberry Pi Foundation sells about 350,000 to 400,000 units a month"
From http://www.belfasttelegraph.co.uk/business/news/raspberry-pi-sales-hit-11-million-and-could-overtake-commodore-64-35245709.html

I'd also like to see dotnet core support aarch64 (suse, debian stretch) on the raspberry pi 3+

@kmleow

This comment has been minimized.

Show comment
Hide comment
@kmleow

kmleow Apr 1, 2017

@Petermarcu on documentation, it says Ubuntu 16.04 is supported. Is this the Ubuntu Core or Ubuntu MATE?

kmleow commented Apr 1, 2017

@Petermarcu on documentation, it says Ubuntu 16.04 is supported. Is this the Ubuntu Core or Ubuntu MATE?

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Apr 1, 2017

Member

@kmleow it should work on either.

Member

Petermarcu commented Apr 1, 2017

@kmleow it should work on either.

@valeriob

This comment has been minimized.

Show comment
Hide comment
@valeriob

valeriob Apr 3, 2017

I've been following the guide here https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md with .net core 2.0.0-beta-001834-00 i published the app, but it does not generate an executable with the name of the project, the folder contains instead an "apphost" elf. When i run it it says :
"root@ubuntu:/home/ubuntu/dev/publish# ./apphost
This executable is not bound to a managed DLL to execute. The binding value is: 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'
A fatal error was encountered. This executable was not bound to load a managed DLL.
"

valeriob commented Apr 3, 2017

I've been following the guide here https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md with .net core 2.0.0-beta-001834-00 i published the app, but it does not generate an executable with the name of the project, the folder contains instead an "apphost" elf. When i run it it says :
"root@ubuntu:/home/ubuntu/dev/publish# ./apphost
This executable is not bound to a managed DLL to execute. The binding value is: 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'
A fatal error was encountered. This executable was not bound to load a managed DLL.
"

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Apr 4, 2017

Member

@valeriob - can you confirm what info you get on the development machine when you run dotnet --version?

Can you also share the contents of your project?

Member

Petermarcu commented Apr 4, 2017

@valeriob - can you confirm what info you get on the development machine when you run dotnet --version?

Can you also share the contents of your project?

@valeriob

This comment has been minimized.

Show comment
Hide comment
@valeriob

valeriob Apr 5, 2017

Thanks @Petermarcu you nailed it !! 💃
I was confused by the version of the shared framework host !
I did the same thing with a AspNet Core app with the same procedure, but it did not produce an executable, however it works running "dotnet mywebapp.dll".

image

valeriob commented Apr 5, 2017

Thanks @Petermarcu you nailed it !! 💃
I was confused by the version of the shared framework host !
I did the same thing with a AspNet Core app with the same procedure, but it did not produce an executable, however it works running "dotnet mywebapp.dll".

image

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Apr 5, 2017

Member

If you get the latest 2.0 sdk as a zip, extract it somewhere and call that version of dotnet for your commands, do you get a different result. That will make sure you are getting the 2.0 sdk.

Member

Petermarcu commented Apr 5, 2017

If you get the latest 2.0 sdk as a zip, extract it somewhere and call that version of dotnet for your commands, do you get a different result. That will make sure you are getting the 2.0 sdk.

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath May 22, 2017

Any update on when .NET Core and ASP.NET Core will be available on Raspbian?

Any update on when .NET Core and ASP.NET Core will be available on Raspbian?

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu May 22, 2017

Member

It should work. Go ahead and try the instructions at https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md and let us know if you hit any problems.

Member

Petermarcu commented May 22, 2017

It should work. Go ahead and try the instructions at https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md and let us know if you hit any problems.

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath May 22, 2017

Thank you, the instructions say Linux, and not Raspbian (specifically), which is why I wanted to make sure, given that the thread above hints that it may not run on Raspbian.

Thank you, the instructions say Linux, and not Raspbian (specifically), which is why I wanted to make sure, given that the thread above hints that it may not run on Raspbian.

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc May 22, 2017

Where exactly do we need to go to get a working dotnet runtime binary? Or do we need to build it ourselves?

TVoc commented May 22, 2017

Where exactly do we need to go to get a working dotnet runtime binary? Or do we need to build it ourselves?

@perlun

This comment has been minimized.

Show comment
Hide comment
@perlun

perlun May 22, 2017

Contributor

Or do we need to build it ourselves?

I think that's the current status. @Petermarcu, is there any chance Raspbian could get added eventually as an official target with prebuilt packages?

Contributor

perlun commented May 22, 2017

Or do we need to build it ourselves?

I think that's the current status. @Petermarcu, is there any chance Raspbian could get added eventually as an official target with prebuilt packages?

@Tealons

This comment has been minimized.

Show comment
Hide comment
@Tealons

Tealons May 25, 2017

I followed the instructions and got it working with Raspbian. I think Raspbian is preferred over Ubuntu, because Ubuntu has a major bug with respect to the Raspberry Pi 3:
https://stackoverflow.com/questions/41353092/ubuntu-freezes-after-boot-starting-kernel-raspberry-pi-3
https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1652270

Tealons commented May 25, 2017

I followed the instructions and got it working with Raspbian. I think Raspbian is preferred over Ubuntu, because Ubuntu has a major bug with respect to the Raspberry Pi 3:
https://stackoverflow.com/questions/41353092/ubuntu-freezes-after-boot-starting-kernel-raspberry-pi-3
https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1652270

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc May 25, 2017

@Tealons If I may ask, how did you accomplish this? Coreclr fails to build on my Raspberry Pi 3 when I try to build dotnet on it.

TVoc commented May 25, 2017

@Tealons If I may ask, how did you accomplish this? Coreclr fails to build on my Raspberry Pi 3 when I try to build dotnet on it.

@Tealons

This comment has been minimized.

Show comment
Hide comment
@Tealons

Tealons May 25, 2017

Like mentioned in the instructions I'm publishing on a Windows machine with linux-arm as the target. The resulting files are copied to the Raspberry Pi: https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md

Tealons commented May 25, 2017

Like mentioned in the instructions I'm publishing on a Windows machine with linux-arm as the target. The resulting files are copied to the Raspberry Pi: https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc May 25, 2017

I see. The application that I want to run on my Pi requires the dotnet runtime, so unfortunately, that is not an option for me.

TVoc commented May 25, 2017

I see. The application that I want to run on my Pi requires the dotnet runtime, so unfortunately, that is not an option for me.

@Tealons

This comment has been minimized.

Show comment
Hide comment
@Tealons

Tealons May 25, 2017

From what I understand the runtime is included in the app when you publish it. Or do you need the cli available for your application?

Tealons commented May 25, 2017

From what I understand the runtime is included in the app when you publish it. Or do you need the cli available for your application?

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc May 25, 2017

It's not my application, and as far as I'm aware, there is no version that is built for the Pi, specifically.

TVoc commented May 25, 2017

It's not my application, and as far as I'm aware, there is no version that is built for the Pi, specifically.

@kinglionsoft

This comment has been minimized.

Show comment
Hide comment
@kinglionsoft

kinglionsoft Jun 5, 2017

@Tealons It works fine with a console application, but not mvc application as dotnet publish failed.
dotnet/cli#6746

@Tealons It works fine with a console application, but not mvc application as dotnet publish failed.
dotnet/cli#6746

@pksorensen

This comment has been minimized.

Show comment
Hide comment
@pksorensen

pksorensen Jun 9, 2017

It should work. Go ahead and try the instructions at https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md and let us know if you hit any problems.

I followed it, but getting a Segmentation fault when running it on raspberry pi zero w.

/cc @Petermarcu

pksorensen commented Jun 9, 2017

It should work. Go ahead and try the instructions at https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md and let us know if you hit any problems.

I followed it, but getting a Segmentation fault when running it on raspberry pi zero w.

/cc @Petermarcu

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

Raspberry Pi Zero doesn't work because it doesn't support armv7 instructions that .net core depends on. It should work on a raspberry pi.

Member

Petermarcu commented Jun 9, 2017

Raspberry Pi Zero doesn't work because it doesn't support armv7 instructions that .net core depends on. It should work on a raspberry pi.

@pksorensen

This comment has been minimized.

Show comment
Hide comment
@pksorensen

pksorensen Jun 9, 2017

thanks @Petermarcu - is this a dependency that will alsways be there or would there be a solution/workaround that would allow us to run on pi zero?

thanks @Petermarcu - is this a dependency that will alsways be there or would there be a solution/workaround that would allow us to run on pi zero?

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

We don't currently have plans to remove the armv7 dependency and it's not really something that can be worked around. At some point we may decide to do that and/or would welcome a community effort to make it work.

Member

Petermarcu commented Jun 9, 2017

We don't currently have plans to remove the armv7 dependency and it's not really something that can be worked around. At some point we may decide to do that and/or would welcome a community effort to make it work.

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath Jun 9, 2017

I apologize for being a little bit dense about this, but is there currently a way to run .NET Core and ASP.NET Core apps on Raspbian. I see instructions and help about how to run apps for those platforms on the Raspberry Pi, but they all involve using non-Raspbian OSes.

shripathi-kamath commented Jun 9, 2017

I apologize for being a little bit dense about this, but is there currently a way to run .NET Core and ASP.NET Core apps on Raspbian. I see instructions and help about how to run apps for those platforms on the Raspberry Pi, but they all involve using non-Raspbian OSes.

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc Jun 9, 2017

As I understand it, you can build your app on a different machine such that it runs on Raspbian; it is self-contained. There is currently no SDK or runtime for Raspbian.

TVoc commented Jun 9, 2017

As I understand it, you can build your app on a different machine such that it runs on Raspbian; it is self-contained. There is currently no SDK or runtime for Raspbian.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

That is correct. You can use the .NET Core 2.0 SDK to build the app, copy it over to your Pi and run it.

Member

Petermarcu commented Jun 9, 2017

That is correct. You can use the .NET Core 2.0 SDK to build the app, copy it over to your Pi and run it.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

Technically, you can probably copy the SDK over to the Pi and see if it works. There is a decent chance but its not tested there and its performance is not ideal for development on the Pi.

Member

Petermarcu commented Jun 9, 2017

Technically, you can probably copy the SDK over to the Pi and see if it works. There is a decent chance but its not tested there and its performance is not ideal for development on the Pi.

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath Jun 9, 2017

Thanks @TVoc

@Petermarcu I am fine building the app elsewhere, and not interested in developing on the Pi. I guess I will wait until the Pi has runtime(s) for the Raspbian OS.

Thank you.

Thanks @TVoc

@Petermarcu I am fine building the app elsewhere, and not interested in developing on the Pi. I guess I will wait until the Pi has runtime(s) for the Raspbian OS.

Thank you.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

What do you mean wait until Pi has runtime(s) for the Raspbian OS? If you follow the instructions here: https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md the output should run on Raspbian.

Member

Petermarcu commented Jun 9, 2017

What do you mean wait until Pi has runtime(s) for the Raspbian OS? If you follow the instructions here: https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md the output should run on Raspbian.

@Tealons

This comment has been minimized.

Show comment
Hide comment
@Tealons

Tealons Jun 9, 2017

Manual for an MVC application:

  1. Create a new MVC app with the latest SDK and via the command line: dotnet new mvc on a windows laptop/pc
  2. Change the cproj file with the following:
<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
  <RuntimeIdentifiers>win-arm;linux-arm</RuntimeIdentifiers>
    <UserSecretsId>aspnet-test6-1765DAD7-51F4-4572-8443-7F7BD9581173</UserSecretsId>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-25159" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0-preview2-25159" />
  </ItemGroup>

</Project>


  1. run dotnet restore
  2. run dotnet publish -r linux-arm
  3. copy the output in the pubished folder (bin\Debug\netcoreapp2.0\linux-arm\publish) to a folder on your raspberry pi (in my case raspbian)
  4. go to the folder by ssh and run: sudo ./yourprojectname

Tada! A working MVC application on your raspberry pi!

Tealons commented Jun 9, 2017

Manual for an MVC application:

  1. Create a new MVC app with the latest SDK and via the command line: dotnet new mvc on a windows laptop/pc
  2. Change the cproj file with the following:
<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
  <RuntimeIdentifiers>win-arm;linux-arm</RuntimeIdentifiers>
    <UserSecretsId>aspnet-test6-1765DAD7-51F4-4572-8443-7F7BD9581173</UserSecretsId>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-25159" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0-preview2-25159" />
  </ItemGroup>

</Project>


  1. run dotnet restore
  2. run dotnet publish -r linux-arm
  3. copy the output in the pubished folder (bin\Debug\netcoreapp2.0\linux-arm\publish) to a folder on your raspberry pi (in my case raspbian)
  4. go to the folder by ssh and run: sudo ./yourprojectname

Tada! A working MVC application on your raspberry pi!

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath Jun 9, 2017

Sigh!

Perhaps I am missing the trick.

I go over to the page you indicated. It tells me how I should build my app, how to change the .csproj, and publish my app to a folder.

Then there is a section on Getting the app to run on the Pi.

The first step is to install Linux. Let's say I do that as well and install Raspbian.

The next step says to install prereq packages. I click on that link, and there is no section for Raspbian. Which makes me wonder if the Linux I had to install in the first step was Ubuntu?

What am I missing?

Sigh!

Perhaps I am missing the trick.

I go over to the page you indicated. It tells me how I should build my app, how to change the .csproj, and publish my app to a folder.

Then there is a section on Getting the app to run on the Pi.

The first step is to install Linux. Let's say I do that as well and install Raspbian.

The next step says to install prereq packages. I click on that link, and there is no section for Raspbian. Which makes me wonder if the Linux I had to install in the first step was Ubuntu?

What am I missing?

@TVoc

This comment has been minimized.

Show comment
Hide comment
@TVoc

TVoc Jun 9, 2017

I think I remember installing all of the packages listed under Ubuntu on Raspbian. I suspect it should work if you did that as well and tried to run your app.

TVoc commented Jun 9, 2017

I think I remember installing all of the packages listed under Ubuntu on Raspbian. I suspect it should work if you did that as well and tried to run your app.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

@shripathi-kamath , you are right. That doc should be updated to be more clear. @TVoc is correct that the Ubuntu instructions should just work. That said, that list there is focused on what you need to do development. If you look here you will see the list of runtime dependencies we have for Debian Jessie which I assume will be much closer to Raspbian.

Member

Petermarcu commented Jun 9, 2017

@shripathi-kamath , you are right. That doc should be updated to be more clear. @TVoc is correct that the Ubuntu instructions should just work. That said, that list there is focused on what you need to do development. If you look here you will see the list of runtime dependencies we have for Debian Jessie which I assume will be much closer to Raspbian.

@Tealons

This comment has been minimized.

Show comment
Hide comment
@Tealons

Tealons Jun 9, 2017

@TVoc Yeah, forgot about that. I did that as the first step in trying to get it working on the raspberry pi. I used the following command:
sudo apt-get install libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev

Tealons commented Jun 9, 2017

@TVoc Yeah, forgot about that. I did that as the first step in trying to get it working on the raspberry pi. I used the following command:
sudo apt-get install libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath Jun 9, 2017

OK @Petermarcu, that clears it up. Thanks again to @TVoc.

OK @Petermarcu, that clears it up. Thanks again to @TVoc.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

For others, this would be the command for the runtime dependencies:

apt-get install libc6 libcurl3 libgcc1 libgssapi-krb5-2 libicu52 liblttng-ust0 libssl1.0.0 libstdc++6 libunwind8 libuuid1 zlib1g

Member

Petermarcu commented Jun 9, 2017

For others, this would be the command for the runtime dependencies:

apt-get install libc6 libcurl3 libgcc1 libgssapi-krb5-2 libicu52 liblttng-ust0 libssl1.0.0 libstdc++6 libunwind8 libuuid1 zlib1g

@Tealons

This comment has been minimized.

Show comment
Hide comment
@Tealons

Tealons Jun 9, 2017

@Petermarcu Funny, seems like de dependencies changed over time?

Tealons commented Jun 9, 2017

@Petermarcu Funny, seems like de dependencies changed over time?

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 9, 2017

Member

@Tealons not really, I dont think we've done a good job documenting the runtime dependencies. This list is also very explicit and many of those things are pulled in transitively by others.

BTW, I missed your comment about making a PR to add ASP.NET scenarios to the how to doc. Go ahead. Just put it in a section at the end so the hello world example still flows and then people can add onto it with ASP.NET.

Member

Petermarcu commented Jun 9, 2017

@Tealons not really, I dont think we've done a good job documenting the runtime dependencies. This list is also very explicit and many of those things are pulled in transitively by others.

BTW, I missed your comment about making a PR to add ASP.NET scenarios to the how to doc. Go ahead. Just put it in a section at the end so the hello world example still flows and then people can add onto it with ASP.NET.

@shripathi-kamath

This comment has been minimized.

Show comment
Hide comment
@shripathi-kamath

shripathi-kamath Jun 10, 2017

Not that anyone asked, but after I added the above-mentioned prerequisites for Raspbian, I successfully built, deployed and executed a sample application on the Pi.

Thank you

shripathi-kamath commented Jun 10, 2017

Not that anyone asked, but after I added the above-mentioned prerequisites for Raspbian, I successfully built, deployed and executed a sample application on the Pi.

Thank you

@TFTomSun

This comment has been minimized.

Show comment
Hide comment
@TFTomSun

TFTomSun Jun 24, 2017

Are you planning to create docker images for Raspbian?

Are you planning to create docker images for Raspbian?

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Jun 25, 2017

Member

@TFTomSun, I believe it's being looked into.

/cc @richlander @MichaelSimons

Member

Petermarcu commented Jun 25, 2017

@TFTomSun, I believe it's being looked into.

/cc @richlander @MichaelSimons

@MichaelSimons

This comment has been minimized.

Show comment
Hide comment
@MichaelSimons

MichaelSimons Jun 26, 2017

@TFTomSun, Yes, .NET Core Docker images that can be used on RaspberryPis are actively being worked on. This is the issue tracking the work.

@TFTomSun, Yes, .NET Core Docker images that can be used on RaspberryPis are actively being worked on. This is the issue tracking the work.

@jeremylindsayni

This comment has been minimized.

Show comment
Hide comment
@jeremylindsayni

jeremylindsayni Jul 23, 2017

If anyone is still hitting problems getting a C# app deployed and working on Raspbian, I wrote a post about my experiences, and how I managed it - https://jeremylindsayni.wordpress.com/2017/07/23/running-a-net-core-2-app-on-raspbian-jessie-and-deploying-to-the-pi-with-cake/

Hopefully this'll help any folks still trying to get running on Raspbian.

If anyone is still hitting problems getting a C# app deployed and working on Raspbian, I wrote a post about my experiences, and how I managed it - https://jeremylindsayni.wordpress.com/2017/07/23/running-a-net-core-2-app-on-raspbian-jessie-and-deploying-to-the-pi-with-cake/

Hopefully this'll help any folks still trying to get running on Raspbian.

@Petermarcu

This comment has been minimized.

Show comment
Hide comment
@Petermarcu

Petermarcu Aug 4, 2017

Member

I'm going to close this issue now because as far as I know, everything is working on Raspbian for .NET Core 2.0. If there are specific issues, we should open a new issue to track them. Thanks to all who contributed to this issue and helped get things moving!

Member

Petermarcu commented Aug 4, 2017

I'm going to close this issue now because as far as I know, everything is working on Raspbian for .NET Core 2.0. If there are specific issues, we should open a new issue to track them. Thanks to all who contributed to this issue and helped get things moving!

@Petermarcu Petermarcu closed this Aug 4, 2017

@florrain florrain referenced this issue in dotnet/core-setup Jan 21, 2018

Open

.NET runtime on RPI - Segmentation fault #3613

@LeonidasFettikus

This comment has been minimized.

Show comment
Hide comment
@LeonidasFettikus

LeonidasFettikus Feb 21, 2018

Hi guys, would it be possible to run a dotnet core app inside a docker container on a Raspberry Pi Zero?

Hi guys, would it be possible to run a dotnet core app inside a docker container on a Raspberry Pi Zero?

@wfurt

This comment has been minimized.

Show comment
Hide comment
@wfurt

wfurt Feb 21, 2018

Member

no, it won't @LeonidasFettikus . The CPU (ARMv6) does not have instructions .NET needs.
(https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md)

Member

wfurt commented Feb 21, 2018

no, it won't @LeonidasFettikus . The CPU (ARMv6) does not have instructions .NET needs.
(https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md)

@LeonidasFettikus

This comment has been minimized.

Show comment
Hide comment
@LeonidasFettikus

LeonidasFettikus Feb 21, 2018

I thought so. Just wanted a confirmation before I abandoned/committed to the idea.

I thought so. Just wanted a confirmation before I abandoned/committed to the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment