GithubHelp home page GithubHelp logo

t2-vm's Introduction

Tessel 2 VM Tool

Code of Conduct

Command line tool to run a Tessel 2 VM for local testing.

Prerequisites

VirtualBox and its extension pack

Installation

npm install -g git+https://github.com/tessel/t2-vm.git

Running a Tessel 2 VM

Make sure you have the t2-cli installed to generate your local key.

t2 key generate
t2-vm create
t2-vm launch

The resulting hostname can be used to push code to the local VM:

t2-vm launch index.js --name Tessel-XXXXXXXXXX

Example usage

TODO: how to use binary builds! For some code to play with in the VM, clone https://github.com/tcr/stillframe, explode the archives, and load it into the VM. The run it from shell using node as usual.

Copyright and License

Copyright 2016 Tessel

Dual-licensed under the Apache License, Version 2.0, and the MIT License.

t2-vm's People

Contributors

duaneobrien avatar frijol avatar huseyinkozan avatar johnnyman727 avatar juliancheal avatar ondreian avatar rwaldron avatar student007 avatar tberthe avatar tcr avatar ujjwalt 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

t2-vm's Issues

Wireless settings different from Tessel 2 hardware

The VM doesn't have a /etc/config/wireless file and lists no wireless devices. Is there anyway we can make the wireless settings from Tessel 2 replicated on the VM? Otherwise the wifi CLI commands won't work.

Error: connect ENOENT /home/cflewis/.tessel/vm.port on create

Related to #34 :

I tried using the VM image given to me by @tcr , but it doesn't progress :(

Again I am scratching my head wondering if it's something to do with it itself being run in a cloud VM.

touching vm.port had no effect.

[cflewis@belle]~❯ sudo t2-vm create
Initializing VM...
(Replacing previous VM...)
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
? Choose a bridge interface (or hit enter) eth0
Downloading image...
........ downloaded ...
Creating VM...
Attaching to serial port: /home/cflewis/.tessel/vm.port
Configuring VM...
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: connect ENOENT /home/cflewis/.tessel/vm.port
    at Object.exports._errnoException (util.js:953:11)
    at exports._exceptionWithHostPort (util.js:976:20)
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)

Error in events.js on t2-vm create on OSX 10.11

Initializing VM...
? Choose a bridge interface (or hit enter) en0: Wi-Fi (AirPort)
Downloading image...
............................................................................................................................................................. downloaded ...
Creating VM...
Attaching to serial port: /Users/ujjwalt/.tessel/vm.port
Configuring VM...
events.js:85
     throw er; // Unhandled 'error' event
           ^
Error: connect ENOENT
   at exports._errnoException (util.js:746:11)
   at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

I'm using node 0.12.7 and npm 2.14.4 although I've tried both node 0.10 and 4.0 and nothing works.

Could not find a registered machine named 'tessel2'

For the case someone will have this problem:

Initializing VM...
(Replacing previous VM...)
VBoxManage: error: Could not find a registered machine named 'tessel2'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(VMName).raw(), machine.asOutParam())" at line 151 of file VBoxManageMisc.cpp
Unhandled rejection Error: 1
    at Object.ensureErrorObject (/usr/local/lib/node_modules/t2-vm/node_modules/bluebird/js/main/util.js:261:20)
    at Promise._rejectCallback (/usr/local/lib/node_modules/t2-vm/node_modules/bluebird/js/main/promise.js:469:22)
    at /usr/local/lib/node_modules/t2-vm/node_modules/bluebird/js/main/promise.js:486:17
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/t2-vm/etc.js:47:14)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:169:7)
    at Process.ChildProcess._handle.onexit (child_process.js:1044:12)

The quick solution is:

  1. change the line 103 of etc.js to something like exports.VM_NAME = 'T2';//'tessel2';
  2. (sudo) npm install -g

Problem should be fixed.
Hope this helps anyone 😉

Enable Webcam passthrough

Webcam control over USB passthrough has many issues in virtualbox: https://www.virtualbox.org/ticket/242

4.3 has experimental support for webcam specific passthrough: https://www.virtualbox.org/manual/ch09.html#idp97292096

If we support USB passthrough configuration (see #9), webcam passthrough can be seamless, e.g.

$ VBoxManage list webcams
Video Input Devices: 2
.1 "Live! Cam Sync HD VF0770"
0x1a120000041e4095
.2 "FaceTime HD Camera (Built-in)"
0x1a11000005ac8510

The last digits of the address (0x1a110000 / 05ac / 8510) match the vendor and device IDs, which is what USB devices in general would be matched on. So, after boot:

$ VBoxManage controlvm tessel2 webcam attach .1

Awaiting hostname never completes

Using the image in #34 , I was able to get as far as getting VirtualBox up and running. It does appear to be doing something (checking top shows the CPU going up quite a bit, and then falling off again), but whatever the create script is waiting for never happens.

I've verified this on my local Ubuntu machine and a cloud Ubuntu VM. Same behavior :/

~/src❯ t2-vm create
Initializing VM...
? Choose a bridge interface (or hit enter) em1
Downloading image...
.......... downloaded ...
Creating VM...
Attaching to serial port: /usr/local/google/home/cflewis/.tessel/vm.port
Configuring VM...
Opened serial connection to VirtualBox...
Awaiting hostname...
This seems to be taking way too long.
Perhaps CTRL+C and try again.

t2-vm create failure

$ t2-vm create
Initializing VM...
(Replacing previous VM...)
VBoxManage: error: Could not find a registered machine named 'tessel2'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(VMName).raw(), machine.asOutParam())" at line 151 of file VBoxManageMisc.cpp
Unhandled rejection Error: 1
    at Object.ensureErrorObject (/Users/rwaldron/clonez/t2-vm/node_modules/bluebird/js/main/util.js:228:20)
    at Promise._rejectCallback (/Users/rwaldron/clonez/t2-vm/node_modules/bluebird/js/main/promise.js:416:22)
    at /Users/rwaldron/clonez/t2-vm/node_modules/bluebird/js/main/promise.js:433:17
    at ChildProcess.<anonymous> (/Users/rwaldron/clonez/t2-vm/etc.js:47:14)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Old settings file can exist and break t2-vm launch

I created a VM a while ago and deleted it with VirtualBox. However, when I try to run t2-vm launch again, I get an error that the old one couldn't be deleted (even though it already was). It looks like the settings file still exists and it's causing the error to be thrown:

➜  t2-vm git:(master) ✗ t2-vm create
Initializing VM...
(Replacing previous VM...)
0%...10%...20%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Machine delete failed
VBoxManage: error: Could not delete the medium storage unit '/Users/Jon/.tessel/vm.vdi'.
VBoxManage: error: VD: error VERR_FILE_NOT_FOUND opening image file '/Users/Jon/.tessel/vm.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium
VBoxManage: error: Context: "int handleUnregisterVM(HandlerArg*)" at line 166 of file VBoxManageMisc.cpp
Unhandled rejection Error: 1
    at Object.ensureErrorObject (/Users/Jon/Work/technical/t2-vm/node_modules/bluebird/js/main/util.js:232:20)
    at Promise._rejectCallback (/Users/Jon/Work/technical/t2-vm/node_modules/bluebird/js/main/promise.js:416:22)
    at /Users/Jon/Work/technical/t2-vm/node_modules/bluebird/js/main/promise.js:433:17
    at ChildProcess.<anonymous> (/Users/Jon/Work/technical/t2-vm/etc.js:48:14)
    at ChildProcess.emit (events.js:110:17)
    at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
➜  t2-vm git:(master) ✗ VBoxManage createvm --name tessel2 --ostype Linux --register
VBoxManage: error: Machine settings file '/Users/Jon/VirtualBox VMs/tessel2/tessel2.vbox' already exists
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "CreateMachine(bstrSettingsFile.raw(), bstrName.raw(), ComSafeArrayAsInParam(groups), bstrOsTypeId.raw(), createFlags.raw(), machine.asOutParam())" at line 275 of file VBoxManageMisc.cpp

Where are my binary builds?

Answer: Working on it. We're going to use a node-pre-gyp like structure for publishing binary builds to a Tessel build server and integration with the t2 CLI to download and integrate these binary builds with code.

Unable to create vm on windows 7

The medium 'C:\Users\rossc.tessel\vm.vdi' can't be used as the requested device type.

Code d'erreur :
E_FAIL (0x80004005)

Composant :
MediumWrap

Interface :
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

Fonction appelée :
IVirtualBox {0169423f-46b4-cde9-91af-1e9d5b6cd945}

Code retourné :
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

error in events.js on t2 key generate (Windows)

Hi,

So I have installed virtual box on my machine and have t2-cli installed. I type the following:

t2 key generate

I then encounter the following error:

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn ssh-keygen ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)

Any idea what might be causing?

Thanks

http://storage.googleapis.com/tessel-builds/ccc157a289db14791ee7250733a0b7b5fb9c06c8.vdi isn't public

Hi there,
I've gone through all the steps using a Google Compute Engine VM. I get as far as t2-vm create, but then it bards with this weird error. My guess is it's something about the fact the VM doesn't report having any USB ports? It does report having eth0 so you would think that was OK.

[cflewis@belle]~❯ sudo t2-vm create
Initializing VM...
? Choose a bridge interface (or hit enter) eth0
Downloading image...
 downloaded ...
Creating VM...
VBoxManage: error: The medium '/home/cflewis/.tessel/vm.vdi' can't be used as the requested device type
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of fil
e VBoxManageDisk.cpp
VBoxManage: error: Invalid UUID or filename "/home/cflewis/.tessel/vm.vdi"
Unhandled rejection Error: 1
    at Object.ensureErrorObject (/usr/local/lib/node_modules/t2-vm/node_modules/bluebird/js/main/util.js:261:20)
    at Promise._rejectCallback (/usr/local/lib/node_modules/t2-vm/node_modules/bluebird/js/main/promise.js:469:22)
    at /usr/local/lib/node_modules/t2-vm/node_modules/bluebird/js/main/promise.js:486:17
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/t2-vm/etc.js:47:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)

Add explicit license to repo

While the ReadMe specifies the license as MIT/ASL2, it is good form to add the specific license texts to the repo. I am happy to submit a PR to update this.

Problem with configuration files

I'm using a self compiled VM image of Tessel2 from https://github.com/tessel/openwrt-tessel
I encountered a problem with the files generated right before calling poweroff (/etc/dropbear/authorized_keys and /etc/config/firewall). They does not seem to be properly written to the virtual hard drive: they can be accessed (by the command cat for example) before the poweroff but are gone once the VM has rebooted. It is probably a HD sync problem either from openWRT or from VirtualBox (The downloaded image does not have this problem)

I found a workaround : add sleep 3 before calling poweroff.

For information, I use VirtualBox 4.3.26 on a Fedora 21

Tessel 2 virtual machine creation error

I am creating tessel 2 virtual machine on ubuntu 14.04 by using following command and getting errors

t2-vm create

I am getting following error message

downloaded ...
Creating VM...
VBoxManage: error: Could not get the storage format of the medium '/home/haider/.tessel/vm.vdi' (VERR_NOT_SUPPORTED)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file
VBoxManageDisk.cpp
VBoxManage: error: Invalid UUID or filename "/home/haider/.tessel/vm.vdi"
Unhandled rejection Error: 1
    at Object.ensureErrorObject (/home/haider/.npm-global/lib/node_modules/t2-vm/node_modules/bluebird/js/main/util.js:261:20)
    at Promise._rejectCallback (/home/haider/.npm-global/lib/node_modules/t2-vm/node_modules/bluebird/js/main/promise.js:472:22)
    at /home/haider/.npm-global/lib/node_modules/t2-vm/node_modules/bluebird/js/main/promise.js:489:17
    at ChildProcess.<anonymous> (/home/haider/.npm-global/lib/node_modules/t2-vm/etc.js:47:14)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)

I have installed all Prerequisites which includes nodejs, tessel-cli, tessel usb rules, virtual box and its extension pack. The versions are as follows

$ nodejs -v
v4.8.4
$ vboxmanage -v
5.0.40r115130

SSH authentication failing for t2-vm

Hey,

I recently forked this repo to add windows support, and fix race conditions occurring in the t2-vm create command, but something seems to be going awry.

after successfully creating a t2-vm and running t2-vm up I try to detect the Tessel 2 with t2 list but keep getting this error:

C:\>t2 list
INFO Scanning for connections...
{ [Error: Timed out while waiting for handshake] level: 'client-timeout' }  // Added for clarity
INFO LAN CONNECTION ip:  10.100.10.14 , name:  Tessel-0800277088D2 , Authorized:  false

I added the Node.js error that was thrown by the t2-cli module for the ssh connection in case it was relevant.

The Node.js stuff I have no problems with, but dissecting the differences between OpenWRT versions of dropbear and what is going on in the T2-vm is being a pain because I cannot SSH into it as my public key isn't matching what it thinks it should be.

Any ideas? The key in the dropbear/authorized_keys seems to match perfectly.

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.