Help getting started with osv

392 views
Skip to first unread message

Haoyi Li

unread,
Apr 24, 2014, 11:44:37 PM4/24/14
to osv...@googlegroups.com
Hey there!

I just start playing around with OSv when I saw you guys had set up EC2 AMIs with convenient links to the management console to spin them up (really clever!). Here's some weirdness I found:
  • When I went here to try and set up a OSv Tomcat server, I was unable to log in via SSH, nor could I navigate to the IP in the browser. I could SSH into the plain OSv server just fine though.
  • Once in the plain OSv server, I tried doing some stuff. I tried running java java/cloudius.jar and java java/runjava.jar but they didn't do anything. 
  • Running run java/cloudius.jar or run java/runjava.jar blew up the instance and I had to reboot it (oops). Using run on other random things just makes it return some exit-code, so I must be doing something particularly bad.
  • I couldn't figure out how to get any java code actually onto OSv; naturally curl and wget didn't work. I gave another shot at logging into my OSv Tomcat instance, but no joy.
Am I missing something, or is the default OSv instance really just bare-bones without anything actually runnable inside? Any idea why I can't SSH into the Tomcat OSv instance? Is there anything else I can play around with short of creating my own images?

Haoyi Li

unread,
Apr 25, 2014, 2:34:55 AM4/25/14
to osv-dev
Also, my first attempt at building my own image makes QEMU hang when it tries to run it.

My Capstanfile:

base: cloudius/osv

cmdline: java Main

files:
  /Main.class: Main.class

Where Main.java is defined as

public class Main {
  public static void main(String[] args) {
    System.out.println("hello, world!");
  }
}

and compiled beforehand

Tomasz Grabiec

unread,
Apr 25, 2014, 4:43:26 AM4/25/14
to Haoyi Li, osv-dev
Hi,


On Fri, Apr 25, 2014 at 8:34 AM, Haoyi Li <haoy...@gmail.com> wrote:
Also, my first attempt at building my own image makes QEMU hang when it tries to run it. 

The Capstanfile is not correct so this may be the reason, although I'd expect some kind of error message should appear in this case. Please see my comments below on how to fix the Capstanfile.
 

My Capstanfile:

base: cloudius/osv

The 'cloudius/osv' base image does not contain a JDK. 

Please use the following (for JDK 7):

base: cloudius/osv-openjdk

or this one (for JDK 8):

base: cloudius/osv-openjdk8


You can list all supplied base images using capstan: 

$ capstan search

 

cmdline: java Main

Our java launcher is named 'java.so', so this should be:

cmdline: java.so Main

Currently to run a native program inside OSv that program needs to be compiled as a shared object. Our java launcher is therefore a shared object and it has the .so extension to follow the naming convention.

You might also want to checkout this capstan example: https://github.com/penberg/capstan-example-java
 
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Haoyi Li

unread,
Apr 25, 2014, 1:32:14 PM4/25/14
to Tomasz Grabiec, osv-dev
Ah, thanks for the pointers. I will give it another shot and come back if I have more questions!

Haoyi Li

unread,
Apr 26, 2014, 12:16:00 AM4/26/14
to Tomasz Grabiec, osv-dev
Hello again!

More questions =)

I've noticed that I *need* to do 

cmdline: /java.so io.osv.MultiJarLoader -mains /javamains

and that

cmdline: /java.so Main

does not work, causing the same hang-qemu-forever behavior I noticed earlier. Is this intentional? Or am I doing something wrong?

Also, I have managed to get my Spray.io Scala web app booting in OSV!

Inline image 1

Unfortunately, I have been unable to connect to it in the browser; is there a setting I can pass to Capstan somewhere to tell it to forward some port or IP address to qemu?

Tzach Livyatan

unread,
Apr 26, 2014, 4:00:21 AM4/26/14
to Haoyi Li, Tomasz Grabiec, osv-dev
On Sat, Apr 26, 2014 at 7:16 AM, Haoyi Li <haoy...@gmail.com> wrote:
Hello again!

More questions =)

I've noticed that I *need* to do 

cmdline: /java.so io.osv.MultiJarLoader -mains /javamains

and that

cmdline: /java.so Main

does not work, causing the same hang-qemu-forever behavior I noticed earlier. Is this intentional? Or am I doing something wrong?

Also, I have managed to get my Spray.io Scala web app booting in OSV!

Inline image 1

Nice! 

Unfortunately, I have been unable to connect to it in the browser; is there a setting I can pass to Capstan somewhere to tell it to forward some port or IP address to qemu?

You can run capstan with nat and use port forwarding:
-f from-port:to-port
or you can use a bridge, and the VM will use 192.168.122.89
On any case, make sure to use the latest capstan version, and use capstan --help to get the latest options
Capstan progress very quickly.

Haoyi Li

unread,
Apr 27, 2014, 2:29:06 PM4/27/14
to Tzach Livyatan, Tomasz Grabiec, osv-dev
Well, I'm almost there...
Inline image 1
How can I increase the amount of heap space that OSv or the OSv-JVM has to run?

FWIW, I'm doing rather unorthodox things like loading my own version of the entire rt.jar into memory as a resource, along with scala-{library, compiler, reflect} as resources, as well as the java std lib and scalac as executable bytecode running the whole show. My "fat jar" is about 105mb and takes about ~2gb of RAM when run on my host machine, so I'm not at all surprised OSv is running out, and probably just need to throw more memory at it.

Pekka Enberg

unread,
Apr 27, 2014, 2:37:40 PM4/27/14
to Haoyi Li, Tzach Livyatan, Tomasz Grabiec, osv-dev
Hello,

On Sun, Apr 27, 2014 at 9:29 PM, Haoyi Li <haoy...@gmail.com> wrote:
How can I increase the amount of heap space that OSv or the OSv-JVM has to run?

OSv JVM memory balloon should give all available memory for the JVM. How much memory are you giving to the guest? Capstan default is 1 GB but you can bump it up with the "-m" command line option.

You can set JVM heap size manually with the -Xmx command line option after "/java.so" in Capstanfile cmdline.

- Pekka

Glauber Costa

unread,
Apr 27, 2014, 2:55:35 PM4/27/14
to Pekka Enberg, Haoyi Li, Tzach Livyatan, Tomasz Grabiec, osv-dev
On Sun, Apr 27, 2014 at 8:37 PM, Pekka Enberg <pen...@cloudius-systems.com> wrote:
Hello,

On Sun, Apr 27, 2014 at 9:29 PM, Haoyi Li <haoy...@gmail.com> wrote:
How can I increase the amount of heap space that OSv or the OSv-JVM has to run?

OSv JVM memory balloon should give all available memory for the JVM. How much memory are you giving to the guest? Capstan default is 1 GB but you can bump it up with the "-m" command line option.
Since I am currently in Germany, let me do as the locals here and be extremely precise: 90 % of the guest memory.

But in any case, it is as Pekka said: you should not need to specify heap size (only guest memory) with OSv. But if you really want to, you can manually specify heap memory using the -Xmx and -Xms options. But they have to be smaller than the current guest memory anyway.
 

You can set JVM heap size manually with the -Xmx command line option after "/java.so" in Capstanfile cmdline.

- Pekka

--

Haoyi Li

unread,
Apr 27, 2014, 5:32:26 PM4/27/14
to Glauber Costa, Pekka Enberg, Tzach Livyatan, Tomasz Grabiec, osv-dev
Yessss it works

Inline image 2

I've successfully run a version of www.scala-js-fiddle.com on OSV on qemu! That comprises
  • Akka 2.3.0
  • a spray-routing webserver
  • the Scala compiler 
  • the ScalaJS compiler
  • the Google Closure Compiler
Of note, it seems to take an order of magnitude more time to boot the application on Qemu/OSV v.s. running locally on my OSX machine or on Ubuntu/EC2; the boot time literally goes from 30 seconds to 10 minutes, and a hot-compile from 5 seconds to 110 seconds. It's a very-heavy-CPU-bound application to boot for it to take 30 seconds on my i7 laptop.

Is the slowness known behavior of OSv? Or is it something to do with qemu? How does one package up the image sufficiently to load onto Amazon EC2 now that I have it booting locally? Would the perf there be better than the perf I'm seeing running locally?

The code is up on github here, or at least it will be when I manage to push my 100mb of jar files to github.

Haoyi Li

unread,
Apr 27, 2014, 5:48:18 PM4/27/14
to Glauber Costa, Pekka Enberg, Tzach Livyatan, Tomasz Grabiec, osv-dev
Also, is the OSv equivalent of rt.jar available somewhere on the OSv filesystem that I can depend upon e.g. to read into memory? I'm currently bundling it which probably accounts for more than half of my 100mb fat jar

Tomasz Grabiec

unread,
Apr 28, 2014, 2:55:25 AM4/28/14
to Haoyi Li, Glauber Costa, Pekka Enberg, Tzach Livyatan, osv-dev
On Sun, Apr 27, 2014 at 11:48 PM, Haoyi Li <haoy...@gmail.com> wrote:
Also, is the OSv equivalent of rt.jar available somewhere on the OSv filesystem that I can depend upon e.g. to read into memory? I'm currently bundling it which probably accounts for more than half of my 100mb fat jar

The OpenJDK is installed under /usr/lib/jvm, so you can find the jar here: /usr/lib/jvm/jre/lib/rt.jar

Glauber Costa

unread,
Apr 28, 2014, 4:46:14 AM4/28/14
to Haoyi Li, Pekka Enberg, Tzach Livyatan, Tomasz Grabiec, osv-dev
On Sun, Apr 27, 2014 at 11:32 PM, Haoyi Li <haoy...@gmail.com> wrote:
Yessss it works

Inline image 2

I've successfully run a version of www.scala-js-fiddle.com on OSV on qemu! That comprises
  • Akka 2.3.0
  • a spray-routing webserver
  • the Scala compiler 
  • the ScalaJS compiler
  • the Google Closure Compiler
Of note, it seems to take an order of magnitude more time to boot the application on Qemu/OSV v.s. running locally on my OSX machine or on Ubuntu/EC2; the boot time literally goes from 30 seconds to 10 minutes, and a hot-compile from 5 seconds to 110 seconds. It's a very-heavy-CPU-bound application to boot for it to take 30 seconds on my i7 laptop.


Yes, if you are using plain qemu with no other kind of acceleration, that whatever you run on top of that is supposed to get extremely slow, and definitely matches the numbers you are seeing. This is because qemu in that case won't be virtualizing anything, but emulating every instruction issued.

Is the slowness known behavior of OSv? Or is it something to do with qemu? How does one package up the image sufficiently to load onto Amazon EC2 now that I have it booting locally? Would the perf there be better than the perf I'm seeing running locally?

Definitely would be better. It would also be better if you used Xen or KVM (Vmware and virtualbox also supported) locally instead of plain qemu.
Now, about uploading to Amazon, take a look at http://osv.io/amazon-ec2/ and let us know if you find any problems

Pekka Enberg

unread,
Apr 28, 2014, 7:26:30 AM4/28/14
to Glauber Costa, Haoyi Li, Tzach Livyatan, Tomasz Grabiec, osv-dev
On Mon, Apr 28, 2014 at 11:46 AM, Glauber Costa <glo...@cloudius-systems.com> wrote:



On Sun, Apr 27, 2014 at 11:32 PM, Haoyi Li <haoy...@gmail.com> wrote:
Yessss it works

Inline image 2

I've successfully run a version of www.scala-js-fiddle.com on OSV on qemu! That comprises
  • Akka 2.3.0
  • a spray-routing webserver
  • the Scala compiler 
  • the ScalaJS compiler
  • the Google Closure Compiler
Of note, it seems to take an order of magnitude more time to boot the application on Qemu/OSV v.s. running locally on my OSX machine or on Ubuntu/EC2; the boot time literally goes from 30 seconds to 10 minutes, and a hot-compile from 5 seconds to 110 seconds. It's a very-heavy-CPU-bound application to boot for it to take 30 seconds on my i7 laptop.


Yes, if you are using plain qemu with no other kind of acceleration, that whatever you run on top of that is supposed to get extremely slow, and definitely matches the numbers you are seeing. This is because qemu in that case won't be virtualizing anything, but emulating every instruction issued.

Right. Using QEMU on OS X is just for testing purposes, you cannot really run real applications with.

Is VirtualBox or VMware not working for you?

- Pekka

Haoyi Li

unread,
Apr 28, 2014, 3:57:34 PM4/28/14
to Pekka Enberg, Glauber Costa, Tzach Livyatan, Tomasz Grabiec, osv-dev
Is VirtualBox or VMware not working for you?

I haven't tried. I just picked Qemu because it was at the top of the wiki page. I have VMware installed for other purposes and will try that.

Haoyi Li

unread,
Apr 29, 2014, 1:45:07 AM4/29/14
to Pekka Enberg, Glauber Costa, Tzach Livyatan, Tomasz Grabiec, osv-dev
Now, about uploading to Amazon, take a look at http://osv.io/amazon-ec2/ and let us know if you find any problems

I looked around on those pages, and saw a bunch of stuff about running existing AMIs on EC2, but I didn't find anything useful in terms of creating my own, other than "Instructions on how to do this will be available soon.". Do you think those instructions could be made available? =)

Haoyi Li

unread,
Apr 29, 2014, 1:53:16 AM4/29/14
to Pekka Enberg, Glauber Costa, Tzach Livyatan, Tomasz Grabiec, osv-dev
I just tried running this on VMware, it's blowing up with the following error message and the VM hangs. It looks like it's booting up Qemu (I see the window pop up) and being unable to run the VMware image. what it should be doing is booting up VMware and running the VMware image. Any idea why it's doing this?

Inline image 1



Asias He

unread,
Apr 29, 2014, 2:37:49 AM4/29/14
to Haoyi Li, Pekka Enberg, Glauber Costa, Tzach Livyatan, Tomasz Grabiec, osv-dev
Hello Haoyi,


On Tue, Apr 29, 2014 at 1:53 PM, Haoyi Li <haoy...@gmail.com> wrote:
I just tried running this on VMware, it's blowing up with the following error message and the VM hangs. It looks like it's booting up Qemu (I see the window pop up) and being unable to run the VMware image. what it should be doing is booting up VMware and running the VMware image. Any idea why it's doing this?

Inline image 1


Try this:

$ capstan build -p vmw

 





On Mon, Apr 28, 2014 at 10:45 PM, Haoyi Li <haoy...@gmail.com> wrote:
Now, about uploading to Amazon, take a look at http://osv.io/amazon-ec2/ and let us know if you find any problems

I looked around on those pages, and saw a bunch of stuff about running existing AMIs on EC2, but I didn't find anything useful in terms of creating my own, other than "Instructions on how to do this will be available soon.". Do you think those instructions could be made available? =)


On Mon, Apr 28, 2014 at 12:57 PM, Haoyi Li <haoy...@gmail.com> wrote:
Is VirtualBox or VMware not working for you?

I haven't tried. I just picked Qemu because it was at the top of the wiki page. I have VMware installed for other purposes and will try that.


On Mon, Apr 28, 2014 at 4:26 AM, Pekka Enberg <pen...@cloudius-systems.com> wrote:



On Mon, Apr 28, 2014 at 11:46 AM, Glauber Costa <glo...@cloudius-systems.com> wrote:



On Sun, Apr 27, 2014 at 11:32 PM, Haoyi Li <haoy...@gmail.com> wrote:
Yessss it works

Inline image 2

I've successfully run a version of www.scala-js-fiddle.com on OSV on qemu! That comprises
  • Akka 2.3.0
  • a spray-routing webserver
  • the Scala compiler 
  • the ScalaJS compiler
  • the Google Closure Compiler
Of note, it seems to take an order of magnitude more time to boot the application on Qemu/OSV v.s. running locally on my OSX machine or on Ubuntu/EC2; the boot time literally goes from 30 seconds to 10 minutes, and a hot-compile from 5 seconds to 110 seconds. It's a very-heavy-CPU-bound application to boot for it to take 30 seconds on my i7 laptop.


Yes, if you are using plain qemu with no other kind of acceleration, that whatever you run on top of that is supposed to get extremely slow, and definitely matches the numbers you are seeing. This is because qemu in that case won't be virtualizing anything, but emulating every instruction issued.

Right. Using QEMU on OS X is just for testing purposes, you cannot really run real applications with.

Is VirtualBox or VMware not working for you?

- Pekka



--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Asias

Haoyi Li

unread,
Apr 29, 2014, 3:09:27 AM4/29/14
to Asias He, Pekka Enberg, Glauber Costa, Tzach Livyatan, Tomasz Grabiec, osv-dev
Cool, that worked! The only thing remaining is to get the image onto EC2 somehow...

Tzach Livyatan

unread,
Apr 29, 2014, 3:28:41 AM4/29/14
to Haoyi Li, Asias He, Pekka Enberg, Glauber Costa, Tomasz Grabiec, osv-dev
On Tue, Apr 29, 2014 at 10:09 AM, Haoyi Li <haoy...@gmail.com> wrote:
Cool, that worked! The only thing remaining is to get the image onto EC2 somehow...
Try 
>scripts/upload-ec2.sh --help

Haoyi Li

unread,
Apr 29, 2014, 3:30:58 AM4/29/14
to Tzach Livyatan, Asias He, Pekka Enberg, Glauber Costa, Tomasz Grabiec, osv-dev
Where is this scripts/ folder you're talking about?

Tzach Livyatan

unread,
Apr 29, 2014, 3:32:56 AM4/29/14
to Haoyi Li, Asias He, Pekka Enberg, Glauber Costa, Tomasz Grabiec, osv-dev
On Tue, Apr 29, 2014 at 10:30 AM, Haoyi Li <haoy...@gmail.com> wrote:
Where is this scripts/ folder you're talking about?

Pekka Enberg

unread,
Apr 29, 2014, 7:06:01 AM4/29/14
to Tzach Livyatan, Haoyi Li, Asias He, Glauber Costa, Tomasz Grabiec, osv-dev
On Tue, Apr 29, 2014 at 10:28 AM, Tzach Livyatan <tz...@cloudius-systems.com> wrote:

On Tue, Apr 29, 2014 at 10:09 AM, Haoyi Li <haoy...@gmail.com> wrote:
Cool, that worked! The only thing remaining is to get the image onto EC2 somehow...
Try 
>scripts/upload-ec2.sh --help

We really should add that capability to Capstan like we have with GCE.

Haoyi Li

unread,
Apr 29, 2014, 1:15:20 PM4/29/14
to Pekka Enberg, Tzach Livyatan, Asias He, Glauber Costa, Tomasz Grabiec, osv-dev
Ah, I'm having trouble getting to my VMware VM now, even though it worked before. running ifconfig on my host shows this, and I can ping it, but sshing fails with a Permission denied (publickey) and I can't reach it in the browser. I have no idea why it worked before. Is there a canonical way of getting the guest IP address that is assigned when you run capstan run?

Nadav Har'El

unread,
Apr 29, 2014, 4:25:08 PM4/29/14
to Haoyi Li, Pekka Enberg, Tzach Livyatan, Asias He, Glauber Costa, Tomasz Grabiec, osv-dev
On Tue, Apr 29, 2014 at 8:15 PM, Haoyi Li <haoy...@gmail.com> wrote:
Ah, I'm having trouble getting to my VMware VM now, even though it worked before. running ifconfig on my host shows this, and I can ping it, but sshing fails with a Permission denied (publickey) and I can't reach it in the browser. I have no idea why it worked before. Is there a canonical way of getting the guest IP address that is assigned when you run capstan run?

Just a silly idea - can you try running "arp" on the host and seeing if you can find your VM there?

Another silly guess: The "permission denied" might also mean you reached the intended ssh server, it just didn't acccept your public key. Did you follow the correct instructions (I don't know what those are...) to get your public key on the guest?

Haoyi Li

unread,
Apr 29, 2014, 6:56:17 PM4/29/14
to Nadav Har'El, Pekka Enberg, Tzach Livyatan, Asias He, Glauber Costa, Tomasz Grabiec, osv-dev
We really should add that capability to Capstan like we have with GCE.

If you do, be sure to re-post here so I'll know to update capstan so I can use it =)

Haoyi Li

unread,
Apr 30, 2014, 12:00:49 AM4/30/14
to Nadav Har'El, Pekka Enberg, Tzach Livyatan, Asias He, Glauber Costa, Tomasz Grabiec, osv-dev
I'm also getting intermittent err socket errors when I capstan run. They go away when I run a second time, but it seems odd that they're happening at all

haoyi-mbp:scala-js-fiddle haoyi$ /usr/local/Cellar/go/1.2.1/bin/capstan run -p vmw -f 8080:8080
Created instance: i1398830381
err socket

dial unix /Users/haoyi/.capstan/instances/vmw/i1398830381/osv.sock: no such file or directory

Haoyi Li

unread,
Apr 30, 2014, 12:09:33 AM4/30/14
to Nadav Har'El, Pekka Enberg, Tzach Livyatan, Asias He, Glauber Costa, Tomasz Grabiec, osv-dev
Also, arp -an worked for finding the VM's IP (turns out it changes each time I boot up OSv using -p vmw) but now I have another problem: I'm seeing the network transfer speed of talking to the VM be reaaaaally slow. I estimate about 3-4kb/s, which means it takes on the order of 1 minute to load a typical web page. Is that something to be expected, and is there any way around it?

Asias He

unread,
Apr 30, 2014, 1:19:16 AM4/30/14
to Haoyi Li, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev
On Wed, Apr 30, 2014 at 12:00 PM, Haoyi Li <haoy...@gmail.com> wrote:
I'm also getting intermittent err socket errors when I capstan run. They go away when I run a second time, but it seems odd that they're happening at all

It is because the first time you start vmware it takes long time to load. The second time, vmware is loaded into memory.

In hypervisor/vmw/vmw.go:

        for i := 0; i < 5; i++ {
                conn, err = util.Connect(c.sockPath())
                if err == nil {
                        break
                }
                time.Sleep(500 * time.Millisecond)
        }

We retry a few times before we report the failure to connect to the socket.



--
Asias

Asias He

unread,
Apr 30, 2014, 1:22:49 AM4/30/14
to Haoyi Li, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
On Wed, Apr 30, 2014 at 12:09 PM, Haoyi Li <haoy...@gmail.com> wrote:
Also, arp -an worked for finding the VM's IP (turns out it changes each time I boot up OSv using -p vmw) but now I have another problem:

We probably should print the ip address of the guest by default.

 
I'm seeing the network transfer speed of talking to the VM be reaaaaally slow. I estimate about 3-4kb/s, which means it takes on the order of 1 minute to load a typical web page. Is that something to be expected, and is there any way around it?

This is of course not expected at all ;-) Something went wrong. 

Takuya, comments?

 


On Tue, Apr 29, 2014 at 9:00 PM, Haoyi Li <haoy...@gmail.com> wrote:
I'm also getting intermittent err socket errors when I capstan run. They go away when I run a second time, but it seems odd that they're happening at all

haoyi-mbp:scala-js-fiddle haoyi$ /usr/local/Cellar/go/1.2.1/bin/capstan run -p vmw -f 8080:8080
Created instance: i1398830381
err socket

dial unix /Users/haoyi/.capstan/instances/vmw/i1398830381/osv.sock: no such file or directory


On Tue, Apr 29, 2014 at 3:56 PM, Haoyi Li <haoy...@gmail.com> wrote:
We really should add that capability to Capstan like we have with GCE.

If you do, be sure to re-post here so I'll know to update capstan so I can use it =)


On Tue, Apr 29, 2014 at 1:25 PM, Nadav Har'El <n...@cloudius-systems.com> wrote:
On Tue, Apr 29, 2014 at 8:15 PM, Haoyi Li <haoy...@gmail.com> wrote:
Ah, I'm having trouble getting to my VMware VM now, even though it worked before. running ifconfig on my host shows this, and I can ping it, but sshing fails with a Permission denied (publickey) and I can't reach it in the browser. I have no idea why it worked before. Is there a canonical way of getting the guest IP address that is assigned when you run capstan run?

Just a silly idea - can you try running "arp" on the host and seeing if you can find your VM there?

Another silly guess: The "permission denied" might also mean you reached the intended ssh server, it just didn't acccept your public key. Did you follow the correct instructions (I don't know what those are...) to get your public key on the guest?







--
Asias

Haoyi Li

unread,
Apr 30, 2014, 12:29:18 PM4/30/14
to Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
We probably should print the ip address of the guest by default.

That would be wonderful!

This is of course not expected at all ;-) Something went wrong. 

If it helps, the VM still boots and runs my application's power-on-self-test at full speed, and the web pages *work*. They're just reaaaallyyy slowwww to download. 

Dor Laor

unread,
Apr 30, 2014, 3:07:28 PM4/30/14
to Haoyi Li, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
On Wed, Apr 30, 2014 at 7:29 PM, Haoyi Li <haoy...@gmail.com> wrote:
We probably should print the ip address of the guest by default.

That would be wonderful!

This is of course not expected at all ;-) Something went wrong. 

If it helps, the VM still boots and runs my application's power-on-self-test at full speed, and the web pages *work*. They're just reaaaallyyy slowwww to download. 

Is that the web pages of your akka application?
How is the restapi response time?

Can you please summaries all your process on fresh wiki page and we'll try to work on the problematic items?
Cheers,
Dor
 



On Tue, Apr 29, 2014 at 10:22 PM, Asias He <as...@cloudius-systems.com> wrote:



On Wed, Apr 30, 2014 at 12:09 PM, Haoyi Li <haoy...@gmail.com> wrote:
Also, arp -an worked for finding the VM's IP (turns out it changes each time I boot up OSv using -p vmw) but now I have another problem:

We probably should print the ip address of the guest by default.

 
I'm seeing the network transfer speed of talking to the VM be reaaaaally slow. I estimate about 3-4kb/s, which means it takes on the order of 1 minute to load a typical web page. Is that something to be expected, and is there any way around it?

This is of course not expected at all ;-) Something went wrong. 

Takuya, comments?

 


On Tue, Apr 29, 2014 at 9:00 PM, Haoyi Li <haoy...@gmail.com> wrote:
I'm also getting intermittent err socket errors when I capstan run. They go away when I run a second time, but it seems odd that they're happening at all

haoyi-mbp:scala-js-fiddle haoyi$ /usr/local/Cellar/go/1.2.1/bin/capstan run -p vmw -f 8080:8080
Created instance: i1398830381
err socket

dial unix /Users/haoyi/.capstan/instances/vmw/i1398830381/osv.sock: no such file or directory


On Tue, Apr 29, 2014 at 3:56 PM, Haoyi Li <haoy...@gmail.com> wrote:
We really should add that capability to Capstan like we have with GCE.

If you do, be sure to re-post here so I'll know to update capstan so I can use it =)


On Tue, Apr 29, 2014 at 1:25 PM, Nadav Har'El <n...@cloudius-systems.com> wrote:
On Tue, Apr 29, 2014 at 8:15 PM, Haoyi Li <haoy...@gmail.com> wrote:
Ah, I'm having trouble getting to my VMware VM now, even though it worked before. running ifconfig on my host shows this, and I can ping it, but sshing fails with a Permission denied (publickey) and I can't reach it in the browser. I have no idea why it worked before. Is there a canonical way of getting the guest IP address that is assigned when you run capstan run?

Just a silly idea - can you try running "arp" on the host and seeing if you can find your VM there?

Another silly guess: The "permission denied" might also mean you reached the intended ssh server, it just didn't acccept your public key. Did you follow the correct instructions (I don't know what those are...) to get your public key on the guest?







--
Asias

Haoyi Li

unread,
Apr 30, 2014, 11:18:59 PM4/30/14
to Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
Running it on the host machine doesnt do anything, whether using the IP you gave me or the IP of the box

haoyi-mbp:scala-js-fiddle haoyi$ time http://192.168.122.89:8000/os/memory/free
-bash: http://192.168.122.89:8000/os/memory/free: No such file or directory
haoyi-mbp:scala-js-fiddle haoyi$ time http://172.16.244.162:8000/os/memory/free
-bash: http://172.16.244.162:8000/os/memory/free: No such file or directory

Can you please summaries all your process on fresh wiki page and we'll try to work on the problematic items?

Uhh, clone this repo:


And build and run it with -p vmw (as described in the readme, you need SBT installedt). Then navigate to the IP port 8080 of the vm, and you can see it slowly trickling down the javascript for the page. You can run it using one of the other commands given (also on the readme) and see it load much much faster.

Not sure if there's anything else you want to know
 

Dor Laor

unread,
May 1, 2014, 8:32:16 AM5/1/14
to Haoyi Li, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
On Thu, May 1, 2014 at 6:18 AM, Haoyi Li <haoy...@gmail.com> wrote:
Running it on the host machine doesnt do anything, whether using the IP you gave me or the IP of the box

haoyi-mbp:scala-js-fiddle haoyi$ time http://192.168.122.89:8000/os/memory/free
-bash: http://192.168.122.89:8000/os/memory/free: No such file or directory
haoyi-mbp:scala-js-fiddle haoyi$ time http://172.16.244.162:8000/os/memory/free
-bash: http://172.16.244.162:8000/os/memory/free: No such file or directory

Can you please summaries all your process on fresh wiki page and we'll try to work on the problematic items?

Uhh, clone this repo:


And build and run it with -p vmw (as described in the readme, you need SBT installedt). Then navigate to the IP port 8080 of the vm, and you can see it slowly trickling down the javascript for the page. You can run it using one of the other commands given (also on the readme) and see it load much much faster.

Not sure if there's anything else you want to know

Hey, that worked like a charm for me. Cheers!
Attached is the raytracing example. Can you specify which exact scala gist code had issues?
Even the space invadors worked

Best,
Dor
Screenshot from 2014-05-01 15:26:43.png

Haoyi Li

unread,
May 1, 2014, 11:44:37 AM5/1/14
to Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
Uhh, just loading the landing page (The one that says Scala-js-fiddle) took a long time. Maybe It's something wrong with the configuration on my machine that's making it take a while. Cool to see it worked for you =)

Haoyi Li

unread,
May 1, 2014, 12:16:46 PM5/1/14
to Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
Is there any simple HTTP server example that I can pull down and try out? Otherwise I'm gonna start minimizing to see if I can come up with the simplest example which exhibits this slowness. Since it worked for you, though, I bet the problem isn't in my Scala code but somewhere in how I set up OSv/VMware

Tzach Livyatan

unread,
May 1, 2014, 2:14:39 PM5/1/14
to Haoyi Li, Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
On Thu, May 1, 2014 at 7:16 PM, Haoyi Li <haoy...@gmail.com> wrote:
Is there any simple HTTP server example that I can pull down and try out? Otherwise I'm gonna start minimizing to see if I can come up with the simplest example which exhibits this slowness. Since it worked for you, though, I bet the problem isn't in my Scala code but somewhere in how I set up OSv/VMware
There is  a simple http server example
Please let us know if it works for you

Dor Laor

unread,
May 1, 2014, 6:47:03 PM5/1/14
to Haoyi Li, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
On Thu, May 1, 2014 at 7:16 PM, Haoyi Li <haoy...@gmail.com> wrote:
Is there any simple HTTP server example that I can pull down and try out? Otherwise I'm gonna start minimizing to see if I can come up with the simplest example which exhibits this slowness. Since it worked for you, though, I bet the problem isn't in my Scala code but somewhere in how I set up OSv/VMware

Hmm, I tried to run it again on a different computer and it seems that I can't get the app to start -
it stuck uploading the JS code like you describe.

It might be cause I had a older base image now and before I downloaded it.
Try to remove cloudius/osv-openjdk and download a 0.08 one (using capstan pull).

Yes :) just tested it and now it works nicely.

Haoyi Li

unread,
May 1, 2014, 6:50:11 PM5/1/14
to Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
Cool! =)

Haoyi Li

unread,
May 2, 2014, 2:59:57 AM5/2/14
to Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, Tomasz Grabiec, osv-dev, Takuya ASADA
I tried clearing the ~/.capstan cache and upgrading to "OSv v0.08". Still seeing the really-slow download rates. Any other ideas? Otherwise I'll wait till there's an easy way of putting it up on EC2 before exploring further.

Tomasz Grabiec

unread,
May 2, 2014, 4:16:28 AM5/2/14
to Haoyi Li, Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
On Thu, May 1, 2014 at 5:18 AM, Haoyi Li <haoy...@gmail.com> wrote:
Running it on the host machine doesnt do anything, whether using the IP you gave me or the IP of the box

haoyi-mbp:scala-js-fiddle haoyi$ time http://192.168.122.89:8000/os/memory/free
-bash: http://192.168.122.89:8000/os/memory/free: No such file or directory
haoyi-mbp:scala-js-fiddle haoyi$ time http://172.16.244.162:8000/os/memory/free
-bash: http://172.16.244.162:8000/os/memory/free: No such file or directory

I think it should be run like this (using curl):


You need to forward the port in capstan first by passing -f 8000:8000

Haoyi Li

unread,
May 2, 2014, 11:24:36 PM5/2/14
to Tomasz Grabiec, Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
Even with -f 8000:8000curl http://172.16.244.162:8000/os/memory/free never returns under both -p vmw and -p qemu. Am I missing anything?Inline image 1

Haoyi Li

unread,
May 2, 2014, 11:59:45 PM5/2/14
to Tomasz Grabiec, Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
Poking around, I suspect (but can't prove) that the port forwarding -f 8080:8080 is borked. The times I managed to get it to work smoothly was through localhost:8080 which indicated that port forwarding was successful. Now I can only access the VM is through the 172.xx.yy.zz address, and localhost no longer works, indicating that port forwarding isn't working. 

Haoyi Li

unread,
May 3, 2014, 6:29:10 PM5/3/14
to Tomasz Grabiec, Dor Laor, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
Yeah, looks like port forwarding isn't working at all; I can reach the vm at the 172 address even without the -f flag, and adding the -f flag doesn't let me access it on local host like I think it should. I'm pretty sure the -f 8080:8080 flag isn't doing anything.

Dor Laor

unread,
May 5, 2014, 7:09:07 AM5/5/14
to Haoyi Li, Tomasz Grabiec, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
On Sun, May 4, 2014 at 1:29 AM, Haoyi Li <haoy...@gmail.com> wrote:
Yeah, looks like port forwarding isn't working at all; I can reach the vm at the 172 address even without the -f flag, and adding the -f flag doesn't let me access it on local host like I think it should. I'm pretty sure the -f 8080:8080 flag isn't doing anything.

Is used the bridged networking option - add to Capstan -n bridge instead of the forwarding

Haoyi Li

unread,
May 6, 2014, 2:39:54 AM5/6/14
to Dor Laor, Tomasz Grabiec, Asias He, Nadav Har'El, Pekka Enberg, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
-n bridge didn't seem to do anything. Am I doing something wrong? I can still only reach the VM at the 172.XX.YY.ZZ address, and downloading stuff from it remains extremely slow, and I can't hit the :8000/os/memory/free URL either.

Inline image 1

Pekka Enberg

unread,
May 16, 2014, 4:57:09 AM5/16/14
to Haoyi Li, Dor Laor, Tomasz Grabiec, Asias He, Nadav Har'El, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
On Tue, May 6, 2014 at 9:39 AM, Haoyi Li <haoy...@gmail.com> wrote:
-n bridge didn't seem to do anything. Am I doing something wrong? I can still only reach the VM at the 172.XX.YY.ZZ address, and downloading stuff from it remains extremely slow, and I can't hit the :8000/os/memory/free URL either.

We don't support network bridging on VMware yet.

Asias, Takuya, or someone with access to VMware care to send a pull request against Capstan?

Pekka Enberg

unread,
May 16, 2014, 4:59:12 AM5/16/14
to Haoyi Li, Dor Laor, Tomasz Grabiec, Asias He, Nadav Har'El, Tzach Livyatan, Glauber Costa, osv-dev, Takuya ASADA
On Fri, May 16, 2014 at 11:57 AM, Pekka Enberg
<pen...@cloudius-systems.com> wrote:
> We don't support network bridging on VMware yet.
>
> Asias, Takuya, or someone with access to VMware care to send a pull request
> against Capstan?

I opened a Github issue for this:

https://github.com/cloudius-systems/capstan/issues/90
Reply all
Reply to author
Forward
0 new messages