Giter VIP home page Giter VIP logo

roborio-vm's Introduction

QEMU RoboRIO ARM Virtual Machine

This is a set of scripts that extracts the files for National Instruments Real Time Linux from the RoboRIO image zipfile, creates an image from them, and provides a script that allows you to run them via the QEMU emulator.

What can you use this for? Well, if you need to compile packages that are difficult to cross compile or build on a resource constrained system, or do testing that requires an ARM platform but does not require actual NI hardware.. this might be for you.

Tested with:

  • Fedora 22/24, OSX (run only)
  • QEMU 2.5.0, 2.6.1
  • FRC images: 2017v8 and 2016v18
    • I tried 2015v23, but there's an error starting the NI configuration daemon and so ssh refuses to start.

It probably works on other Linux distributions, and may even work with OSX if you adjust the scripts to work there.

Requirements

For creating an image:

  • A linux host with the following installed:
    • mkfs
    • unzip
    • qemu-img, qemu-nbd
    • root permissions

For running the created image:

  • QEMU arm emulator (qemu-system-arm)
    • Works on Linux and OSX

Creating the Virtual Machine root filesystem

First, you need the image zipfile that is distributed with the FRC Update Suite. On a machine with the RoboRIO imaging program installed, you can find it at:

C:\Program Files (x86)\National Instruments\LabVIEW 2015\project\roboRIO Tool\FRC Images

Copy the zipfile to your Linux host, and run the following:

./create_rootfs.sh /path/to/FRC_roboRIO_*.zip

Give it a few minutes, enter in your password when prompted, and at the end you should end up with an image file and a kernel file. This only needs to be done once.

Running the Virtual Machine

Simple command:

./run_vm.sh

At the moment there are a lot of error messages, but eventually it will finish starting and you can login via the console or via SSH.

To SSH into your VM, you can execute the following:

ssh admin@localhost -p 10022

Or, you can setup an SSH alias by adding this to .ssh/config:

Host roborio-vm
  User admin
  Hostname 127.0.0.1
  Port 10022

Then you can login using the following:

ssh roborio-vm

Snapshots

QEMU has good support for snapshots and other such things. When the rootfs is created, an initial snapshot is created in case you want to revert the VM back to a 'pristine' state. To do so:

qemu-img snapshot -a initial roborio.img

There is now also a reset.sh command that you can run to do this.

Known issues

  • I haven't figured out a good way to safely shutdown the system
  • Probably should use a different filesystem for the image
  • Lots of error messages on bootup, would be nice if we could use the actual kernel used on the RoboRIO (this seems like it should be possible)

Building QEMU from source

Download latest version of QEMU, and...

tar -xf qemu-2.6.1.tar.bz2
cd qemu-2.6.1
mkdir build
cd build
../configure --target-list=arm-softmmu --enable-fdt
make
make install

Versions of QEMU that I've had work for me:

  • 2.5
  • 2.6.x
  • 2.8.x

Versions known to not work:

  • 2.7.0

Contributing new changes

This is intended to be a project that all members of the FIRST community can quickly and easily contribute to. If you find a bug, or have an idea that you think others can use:

  1. Fork this git repository to your github account
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push -u origin my-new-feature)
  5. Create new Pull Request on github

Authors

These scripts are not endorsed or associated with Xilinx, FIRST Robotics, or National Instruments.

roborio-vm's People

Contributors

jacibrunning avatar virtuald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roborio-vm's Issues

Running on MacOS

I just attempted to create the image and run on MacOS. I found that creating the image had issues because modprobe does not exist on Mac. I tried to get it to work using hdiutil, but I wasn't able to do so with half an hour of work. Instead, I created the image on a Linux computer and transferred it back to my Mac. Running the vm seems to work fine.

I installed Qemu 3.1.0 using Homebrew (brew install qemu)

The only change I had to make was removing the -localtime line in run_vm.sh.

VM hangs at usbhid: USB HID core driver

Hello,

After setting up the VM using FRC_roboRIO_2017_v8.zip and launching it, it hangs at usbhid: USB HID core driver and uses up the entirety of one of my CPU cores. I have attempted creating the VM on two computers (one running Fedora 25 x86_64 and the other running Debian 8 x86_64) and the issue is present on both of them. What could be the source of this issue?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.