[UPDATE: Note that the version of Snappy described in this post is now obsolete – I have a new post describing a newer version which works better, and slightly differently.]
This post consists of a few notes which may be helpful for people trying to get started with Snappy Ubuntu Core on the new Raspberry Pi 2. First of all note that Ubuntu requires ARM7 so it won’t run on any model of Raspberry Pi prior to the Raspberry Pi 2 (model B), released February 2015.
The Ubuntu Core image can be downloaded from the Raspberry Pi downloads page, and written to uSD card in the usual way, just as you would a Raspbian image. From my Ubuntu laptop, I use a command like:
% sudo dd bs=1M if=pi-snappy.img of=/dev/mmcblk0
Be very careful to get the device name correct for of, as this command will completely trash the output device.
Once you have an image on a uSD card, you can insert it into your Pi 2 and boot it up as usual. If you have a keyboard and display hooked up you can log in on the console, but note that Ubuntu Core can be used headless from first boot via ssh. The default username and password are both ubuntu. I ssh in to my device with a command like ssh ubuntu@raspi08.home. Ubuntu Core uses the new containerised “snappy” system for managing packages, so “apt” doesn’t work. To get an idea of how snappy works, you can read through the snappy tour from Canonical, but note that much of this tour won’t actually work on the Pi 2 right now. Here’s a console session:
ubuntu@localhost:~$ snappy info release: ubuntu-core/devel frameworks: apps: ubuntu@localhost:~$ snappy versions Part Tag Installed Available Fingerprint Active ubuntu-core edge 2 - f442b1d8d6db3f * This command needs root, please run with sudo ubuntu@localhost:~$ snappy search docker No matching packages found: docker ubuntu@localhost:~$
You will note that Docker isn’t currently available for Ubuntu Core on the Pi 2, though hopefully that will change soon. However, at the time of writing you may also find that the final command bombs with a certificate error. This turns out to be due to the fact that the system time is incorrect. You can verify this by running date. You can manually set it with a command like
sudo date -s "Sat Feb 7 09:57:32 GMT 2015"
where you paste in the output from running date on a system which does have the correct time. You can also automate this by instead using a command like
sudo date -s "`ssh username@linuxserver date`"
where username and linuxserver are replaced appropriately. At the time of writing there are very few Snappy packages available, but one useful package is webdm. You can search for it with snappy search webdm and install it with
sudo snappy install webdm
Running snappy info will confirm that it has installed correctly. This runs a web based package manager on port 4200, so, for example, I can connect to this from a web browser on the local network using the URL http://raspi08.home:4200/. This allows the browsing of available frameworks and apps.
There currently isn’t any app or framework for Java, but manually downloading and installing Oracle’s JDK8 for ARM works fine, and runs code at the same speed as using the JVM which ships with Raspbian. It would be very easy to package up the JDK8 as a Snappy app or framework, but I guess that there are licensing issues, so I’ll leave that to others to sort out! You can find out more about how Snappy works by reading Canonical’s snappy guides.
I quite like the Snappy system, and running Ubuntu Core on a Pi 2 is potentially a great way to learn about Cloud computing in a very cheap, simple and safe way. However, we need a few key apps and frameworks before it will become genuinely useful. Ubuntu Core certainly isn’t about to replace Raspbian as the main OS for the Raspberry Pi 2 any time soon.
Any idea what the default hostname is? or anyway to set it up?
On a home network this is usually something that you can figure out and configure with your router/hub/DHCP server.
Hi, I’m a long-term C language user, and I always use wiringPi library to control the GPIO of The Raspberry Pi. Recently, I burned Snappy Ubuntu Core OS image into SD card and plug it into my Raspberry Pi 2. But I find that I can not install wiringPi on the Snappy Ubuntu Core. It prompt me that make tool is not installed. Can you tell me how can I install make or gcc to Snappy Ubuntu Core? Besides, is there have anther way to control GPIO based on Snappy Ubuntu Core for Raspberry ?
Thanks !
Thanks for the details.
I’m using the Snappy img downloaded yesterday from the link you provided. I have a keyboard and mouse connected, but when I boot up I just get a black screen with 4 raspberries at the top-left and nothing else. I can Ctrl+Alt+Delete to restart, but otherwise there’s no response. Same as described here: http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=99316&p=689536
When you booted up did you get a terminal where you could log in? What are we doing differently, do you know?
I’d be happy to ssh in but I have no way of knowing what the hostname would be…
Any advice is appreciated, thanks.
How long did you wait? On the first boot it took an age to go from the 4 raspberries to the console login prompt (several minutes). It might be worth re-flashing the card and trying again, being sure to be patient on the first boot. I did have a wired network connection – not sure if that’s necessary.
Try unplugging your mouse. I think it’s keyboard only for the line commands in Snappy. The boot script could be hanging up.
Thanks for the reply. I waited about 20 minutes; the screen went black altogether. I was using wired network.
Good to know how it worked for you. I might try again.
I tried again after re-flashing the card – same thing. If I touch keys every so often it doesn’t go blank (screen saver), but still just four raspberries – nothing I can do.
However, now I’m trying to boot my Pi 2 with Raspbian and it’s not getting past the coloured screen, so maybe something else is up…
startx does not seem to work?
No – it is important to understand that this is not a general purpose user OS. It is a minimal core OS to use as a base for deploying applications.
Did you manage to get the WiFi dongle working? I am using a dongle that works with raspian not sure if it would work with Snappy.
I’m with Lindsay here: Nothing after the four raspberries.
I dd-ed the Snappy .img to the uSD using OSX, and checking the card from a true Linux box, the partitions look quite OK. But no success booting the Raspi2. … Relief: My regular Raspian uSD booted nicely after switching cards and power-cycling. (phew!)
… Re-dd-ing the Snappy .img now from above mentioned Linux box as I’m typing. I’ll let you know if that helped.
No, it didn’t. I came back after about 20 minutes and I found the Raspi2 “dead”, i.e. the DVI monitor black. Pressing keys on the keyboard did nothing, although CapsLock switched the LED on and off. I couldn’t connect via ssh over ethernet: It had not requested an IP via DHCP (according to my DHCP server).
Got it!
It is somehow related to my ancient Nec Multisync LCD1970NXp (1280×1024 / 4:3) monitor that I hooked to the Raspi2 via HDMI/DVI adapter.
What I did to solve the issue was: I mounted the system-boot partition (the one with the VFAT filesystem that can be mounted on Mac/Win/Lin), edited config.txt and uncommented the “hdmi_safe=1” line to force a safe HDMI/DVI graphic mode.
This time, when powering up, the four raspberries were _huge_, and while I was still staring at the uSD activity LED and thinking that at least something was going on, suddenly the Ubuntu login prompt showed up in huge letters – and I could also connect to the Raspi2 via SSH.
… I’ll experiment further. I’ll now try to copy the HDMI related lines from my Raspian over to the Ubuntu to get a nicer text console.
I dd-ed the image to an SD card, and the rpi boots the GPU, showing the standard colorburst. It then shows a blank shell screen with a raspberry in the top left, and after about three quarters of a second, reboots itself and this process repeats, as far as I can tell indefinately. Does anyone have a suggestion about what to do?
Thanks!
P.S. I used the Rpi to burn the image, running off an OS I installed on a USB drive, and I am using the B+ model.
Sorry, but as explained in the first para, Ubuntu won’t run on the B+
Thank you. This information was very helpful. I ran through the Snappy commands on my new RPI-2 and all worked as advertised. I’ll be checking back for updates.
How can I install the Pipelight plugin for watching Maxdome. I have Snappy ubuntu installed on a Raspberry Pi 2. Please help.
Maybe have I to install another Programe like Raspian?
Setting aside the fact for a moment that Snappy is not really an end-user Linux distribution –
It is highly unlikely that you will be able to run Pipelight or any other kind of Wine driven Windows software on a Raspberry Pi. Wine provides a compatible environment inside a Linux (or Mac) operating system so that WinTel binary applications will run. “WinTel” means that those will be (among others) .exe or .dll files that have been compiled for a x86 or x64 CPU and for a Win32 or Win64 OS.
Even if Wine as a piece of Open Source Software could be successfully cross-compiled for an ARM machine like the Raspi, the .exe / .dll files would still not run, as they are meant for a totally different CPU architecture.
Seen from this perspective, Pipelight will never run on an Raspberry Pi (neither on Raspbian nor on Ubuntu, if a fully fledged desktop Ubuntu should become available at some point), as the Raspi would have to emulate the Intel compatible CPU, which it simply doesn’t have enough processing power.
Thank you for your good explanation.
But now I found this: http://pipelight.net/cms/installation.html
On this Website is an Installation Guide how to install Pipelight on different Systems. Is that a joke, or what means that Website?
I will be crazy… :-(
No, this is certainly not a joke. Pipelight as a Wine based package can be installed on various x86/x64 based Linux systems, such as Ubuntu, Arch Linux, Debian, SuSE, etc. etc.
But you need to understand that Linux is somewhat platform-independent, so an Debian for x86 CPUs is very similar to a Debian for ARM CPU like Raspbian: More or less every piece of Debian compatible software that is available in source code can be compiled to run *either* on x86 *or* ARM.
The problem is: Pipelight and its foundation Wine is open source software, but the actual software that you would like to run within Pipelight/Wine, i.e. Microsoft Silverlight or Adobe Flash, is not. It is available for x86 alone. To run this, your computer needs to run a x86 or x64 CPU, a/k/a Intel compatible.
So: The Pipelight installer page omits the (somewhat obvious) fact that it can run only on a platform that supports x86/x64 binary code being run within Wine. A Raspi will never be able to run x86/x64 code.
… Ok, Ok, this is only half true: Dosbox is a tool that emulates a whole PC with the goal to run old DOS games on a Raspi. So this actually emulates a x86 CPU. But we are talking about old DOS games, not modern Windows multimedia frameworks like Silverlight or Flash.
No, this is certainly not a joke. Pipelight as a Wine based package can be installed on various x86/x64 based Linux systems, such as Ubuntu, Arch Linux, Debian, SuSE, etc. etc.
But you need to understand that Linux is somewhat platform-independent, so an Debian for x86 CPUs is very similar to a Debian for ARM CPU like Raspbian: More or less every piece of Debian compatible software that is available in source code can be compiled to run *either* on x86 *or* ARM.
The problem is: Pipelight and its foundation Wine is open source software, but the actual software that you would like to run within Pipelight/Wine, i.e. Microsoft Silverlight or Adobe Flash, is not. It is available for x86 alone. To run this, your computer needs to run a x86 or x64 CPU, a/k/a Intel compatible.
So: The Pipelight installer page omits the (somewhat obvious) fact that it can run only on a platform that supports x86/x64 binary code being run within Wine. A Raspi will never be able to run x86/x64 code.
… Ok, Ok, this is only half true: Dosbox is a tool that emulates a whole PC with the goal to run old DOS games on a Raspi. So this actually emulates a x86 CPU. But we are talking about old DOS games, not modern Windows multimedia frameworks like Silverlight or Flash.
Ok, thank you very much.
Now, I understand.
That is very sad. I was hopefully, that I can use the Raspberry for steaming Videos like Maxdome, Netflix or other.
Best regards.
Does anyone know how to change the webdm port? to 8080 lets say
Regarding the manual setting of time, an alternative to pulling the time from another server is to push the time from another server. See this github gist for details: https://gist.github.com/daryltucker/5dd1fc9d42646a3bf1be
I have just started using Snappy Ubuntu and have found your information quite useful. I was able to login since I did not know the username & password. I was able to set the date & time manually, and I created the push_date.sh file using vi. Not sure how to use the sh file at this point. I was able to get the “snappy info” which turned out to be frameworks: webdm – the image that I got was from today’s https://www.raspberrypi.org/downloads/ – Snappy Ubuntu Core Snappy Ubuntu Core for Developers download.
How to we get docker up and running on Snappy ?. I did install it using “snappy install docker” and see that it’s installed. But Beyond it, don’t see docker startup scripts working. Any help in with working examples of how to run a sample docker container inside snappy would be helpful.
I want to use my Pi2 as a web and e-mail server.
Any ideas or tutorials on how to setup Apache Tomcat in Snappy Core?
Do I have to create a snap for Tomcat and, if so, do I have to create a JDK8 snap too?
Yes, I think the idea is that you would have a snappy framework containing JDK8 and Tomcat, and then deploy your snappy web apps on top of that.
My remote system didn’t return the date in the correct format so I used
sudo date -s “`ssh pi@192.168.3.14 ‘date “+%F %T”‘`”
To set the snappy clock.
Why can’t Raspberry Pi play Vevo youtube videos, and it can’t play CBS’s website shows. It says there’s no adobe flash, but it won’t install? I tossed my media center PC to use this because so many people say it can be used the same way. It’s not working right :\
Great guide thanks. I ended up writing one to get Snappy Core on a Linode as well.
Though limited, Snappy Core is pretty fun to just play with. Something new :)
How can you connect to Pi with ssh ubuntu@raspi08.home ? What is the required IP address? I don’t have separate monitor and keyboard. I want to SSH using laptop and LAN. Any help in this direction will be great! Thank you..
On a home network you can usually use your router’s web admin tool to figure out the IP address that it has assigned to the Pi. Failing that, if you have a linux machine on your network you can run “nmap” on it to scan the network, and I’m sure there are similar tools for Windows, Mac, etc.