Cannot start Fuchsia Emulator on Ubuntu - fuchsia

I am trying to build Fuchsia OS and run it on the Fuchsia Emulator femu, but after waiting for the emulator to start the fx command exists and displays the error below.
failed to create Fuchsia device device health check failed. Unable to ssh due to error:
Error: Cannot start Fuchsia Emulator. Exit status is 1
I have followed the instructions provided by Google at fuchsia.dev, the build completes successfully and the commands used to build the OS were
fx set core.qemu-x64 --with //examples/hello_world
fx build
Subsequently, I tried running in headless mode with fx vdl start -N --headless which results in the same error as above, I also tried build the OS without the --with argument but received the same error.
The log file gives us more details, the second last line of the log file may be of interest and it reads:
emu-system-x86_64-headless: network script /etc/qemu-ifdown failed with status 256
I am using Ubuntu 21.04 on my machine.

It seems that the network configuration scripts /etc/qemu-ifup and /etc/qemu-ifdown are missing. You can work around it by installing the qemu package:
$ sudo apt install qemu

Related

Can't run Fuchsia components with shell

So I am trying to get started developing on Fuchsia and I wanted to get the hello world component to run. However, following these steps doesn't work for me. I'm using core.qemu-x64 running on an Ubuntu 20.04 VM with Virtual Box. I have gotten the emulator to run with fx qemu -N but fx vdl start -N hasn't worked for me.
I run fx serve-updates but it just outputs "Discovery..." and never changes. Then I try to run fx shell run fuchsia-pkg://fuchsia.com/hello-world-cpp#meta/hello-world-cpp.cmx but it says "No devices found." It seem like this shouldn't be an issue because with Linux the device finder should automatically pick it up. Regardless I tried following the MAC instructions and setting the device with fx set-device 127.0.0.1:22. That just makes the run command say "ssh: connect to host 127.0.0.1 port 22: Connection refused". I also tried to set it to the device to the nodename outputted by the fx qemu -N command which is "fuchsia-####-####-####" but that just makes the run command say no devices are found again.
I have verified that I actually have the hello-world packages with the fx list-packages hello-world which outputs all the hello-world packages as expected.
Is there any way I can get the device to be discoverable by the shell command? Alternatively, can I run components like the hello-world component from the qemu emulator directly?
Please let me know if I can provide any additional information.
I guess I just wasn't patient enough. I assumed the emulator was done getting setup because it stopped giving console output and it allowed me to input commands but it seems I just had to wait longer. After 50 minutes of the fx qemu -N command running, the terminal that had fx serve-updates going finally picked up the device. Then I was able to execute the hello world component. It would be nice if the documentation at least gave an idea of how long the different commands would take before they'd be usable.

What is causing this project to fail on Macbook Pro when It runs just fine on windows 10

I have a nativescript application in windows that deploys to the emulator just fine, but when I git clone onto the MacBook Pro and run the same process, I get:
new-host:nativescript jbaird$ tns run android
Searching for devices...
Starting Android emulator with image Nexus_5X_API_26
Waiting for emulator device initialization...
Executing before-liveSync hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-prepare hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
Preparing project...
Project successfully prepared (Android)
Building project...
Unable to apply changes on device: emulator-5554. Error is: spawn EACCES.
Executing after-watch hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/after-watch/nativescript-dev-typescript.js
Any ideas? Thanks in advance.
The error is a permission error. Therefore, all you need to do is give access to the the folder you are running your apps from. The process involves you to copy and paste the command below into your terminal.
sudo chmod -R a+rwx /AppFolder
The command is an administrator command, therefore, you may have to insert your system password.
PS: Definitely, you hit enter and there will be a prompt for you to insert your password.
Let me know if you have any challenges with this solution!
emulator-5554. Error is: spawn EACCES.emulator-5554. Error is: spawn EACCES.
Seems a permission error. You could solve it by:
sudo,
Or, by giving +x permision to your hooks folder?

Run a gui application on cygwin

I am building application that is using OpenCV lib to show images. The application fails at the following line:
cv::namedWindow(....);
I am using cygwin on Windows 10, and using CLion IDE.
The executable is built successfully but when run it shows the following error:
(Display Image:10340): Gtk-WARNING **: cannot open display:
I made sure xinit is installed and its dependencies using cygwin setup.
I've run the x server using a batch file with the following content:
c:\cygwin\bin\run.exe -p /usr/X11R6/bin XWin -listen tcp -multiwindow -clipboard -silent-dup-error
And I can see the 'X' icon in notification icons area, but still getting the error when I try to run the executable. I tried running it both from CLion and from cygwin console but same result.
What is it that I am missing?
To run a program that need access to a X Server you need:
1) a running X Server
2) the variable DISPLAY defined
If you check from Xterm you will have:
$ echo $DISPLAY
:0.0
So your program can run as DISPLAY is defined and the X server is found.

running xvfb-run on OS X 10.11

Is it possible to get xvfb-run to work in the newest version of OS X? I've installed XQuartz and Xvfb runs the scripts with the following command:
Xvfb :4000 & export DISPLAY=:4000 & rspec
instead of this one:
xvfb-run rspec
This is however not without fault, either the temp file "x4000-lock" will not get removed after the script is finished and stop Xvfb to start up again or I'll recieve this error next time the script runs:
[2] 13220
[3] 13221
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)
Run options: include {:focus=>true}
This error is also recieved on a linux system so i Suspect "xvfb-run" is doing something more in the background and thus wondering how to get that running in OS X

Getting "Device offline" error even though emulator is running

I just installed the android sdk (3.0) on my Mac 10.6.3. I started the emulator successfully using
./emulator -avd my_android &
However, when I try and run a forward command using adb, I get the following error ...
davea-mbp2:platform-tools davea$ ./adb forward tcp:8080 tcp:8080
* daemon not running. starting it now on port 5037 *
* daemon started successfully
error: device offline
Does anyone know what the error means? My emulator is up and running (http://screencast.com/t/bD8WYjZ1) when I run the above command, - Dave
This is an old question but anyway - just had the same issue.
I eventually fixed it by deleting the device and creating a similar one with another name. Recreating the device with the same name did not do the trick.

Resources