tessel / t2-vm Goto Github PK
View Code? Open in Web Editor NEWRun and develop for Tessel 2 in a virtual machine.
License: Apache License 2.0
Run and develop for Tessel 2 in a virtual machine.
License: Apache License 2.0
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
What are the steps to build the vdi? In situations where download isn't possible, it would be nice to build locally.
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
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 code of conduct badge, a la tessel/project#190
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.
Currently related to this bug: tessel/t2-cli#70
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
See #11. Check out branch https://github.com/tessel/t2-vm/tree/ondreian-patches for race condition patches. /cc @ondreian
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)
Or whatever is currently shipping in Tessel 2 openwrt builds
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.
This is blocked by #9 to do a proper write-up. Once that is complete / possible, I'll update this issue with instructions.
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
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.
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
eg.
rwaldron at nova in ~/test-t2-vm
$ t2-vm run index.js --name Tessel-080027E2A051
DEPRECATED: Use the command "t2-vm launch" instead.
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:
exports.VM_NAME = 'T2';//'tessel2';
Problem should be fixed.
Hope this helps anyone 😉
"t2-vm run" reads like it were running the current directory of code (e.g. t2 run
)
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.
Probably we should have a vm-config.json
file instead of vm_name
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.
This should be configured at boot time.
Proposing t2-vm launch --mem 32
for testing different memory limits, as a way to gain finer control of testing scenarios.
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.
touch
ing 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)
$ 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)
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.