A minimal vm

27 views
Skip to first unread message

mmarco

unread,
Nov 9, 2011, 5:59:56 AM11/9/11
to sage-devel
I have created a virtual machine with sage and a very minimal system.
In my machine (a core i7 desktop) it boots in less than 10 seconds,
and has a sage server running in around 20 from the pressing of the
start button.

It can be downloaded from
http://riemann.unizar.es/sagevm/Sage.ova

I don't have any windows box available, so please test it and give me
some feedback.

Also, i didn't know how to avoid the mouse cursos capture. If someone
knows how to disable it, please let me know.

I used gentoo to set up a very minimal OS, compiled a kernel with only
the needed options, compiled sage from source, and then removed the
kernel sources and the portage tree to save disk space.


Miguel Marco

Emil Widmann

unread,
Nov 9, 2011, 6:15:20 AM11/9/11
to sage-devel


On Nov 9, 10:59 am, mmarco <mma...@unizar.es> wrote:
> I have created a virtual machine with sage and a very minimal system.
> In my machine (a core i7 desktop) it boots in less than 10 seconds,
> and has a sage server running in around 20 from the pressing of the
> start button.
>
> It can be downloaded fromhttp://riemann.unizar.es/sagevm/Sage.ova
>
> I don't have any windows box available, so please test it and give me
> some feedback.
>
> Also, i didn't know how to avoid the mouse cursos capture. If someone
> knows how to disable it, please let me know.
>
> I used gentoo to set up a very minimal OS, compiled a kernel with only
> the needed options, compiled sage from source, and then removed the
> kernel sources and the portage tree to save disk space.
>
> Miguel Marco

Hi Marco,

I wanted to test it but I cant download from the link you gave.
How big is the ova file? I am just curious, I am working on something
similar.

I have also problems with mouse pointer Integration and have not found
a solution to permanently dissable it (maybe there is an option using
VBoxManage).

mmarco

unread,
Nov 9, 2011, 6:34:18 AM11/9/11
to sage-devel
The .ova file is 2 gigs big.

It's strange that the link doesn't work for you. It does work for me
form different systems and locations. Maybe you can try copying the
url directly to your browser. Pay atention to the capital S in
Sage.ova

Jan Groenewald

unread,
Nov 9, 2011, 6:41:51 AM11/9/11
to sage-...@googlegroups.com
Dear Marco,

On 9 November 2011 13:34, mmarco <mma...@unizar.es> wrote:
The .ova file is 2 gigs big.

What makes it this big? I would guess 500M minimal install, 500M Sage,
and the rest is desktop stuff?

Is it not possible to install a server/minimal version of your OS and on that sage and to
browse using the native OS' browser to the virtual OS' IP:sageport?
Might this not halve the size? You can also automatically start
Sage and not have to click a start button and boot even faster?

Regards,
Jan
 

--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^


Emil Widmann

unread,
Nov 9, 2011, 6:49:14 AM11/9/11
to sage-devel
Ok it works - downloading it now. I had to use
wget http://riemann.unizar.es/sagevm/Sage.ova
Anyway - 2 GB is big! - how big is it if you lzma it?

mmarco

unread,
Nov 9, 2011, 8:00:29 AM11/9/11
to sage-devel
It is that big because just the sage directory itself is very big. The
guest OS is really very minimal: almost no services running, and only
installed the very basic stuff (no x server, for instance).

Maybe some space could be freed if, after compiling, the source code
could be erased. But i am not sure if it would save a lot of space.

Emil Widmann

unread,
Nov 9, 2011, 10:06:01 AM11/9/11
to sage-devel
On Nov 9, 1:00 pm, mmarco <mma...@unizar.es> wrote:
> It is that big because just the sage directory itself is very big. The
> guest OS is really very minimal: almost no services running, and only
> installed the very basic stuff (no x server, for instance).
>
> Maybe some space could be freed if, after compiling, the source code
> could be erased. But i am not sure if it would save a lot of space.

It is definitely possible to delete the source code. If you have
enough diskspace you can use the command sage -bdist. This builds a
binary distribution in an extra directory. I think source is about 380
MB, so it would be almoust - 20%.

Main trick to get lower size is to use compressed filesystems
systematically (like squashed fs).
This is my current smallest size machine (with X):
http://boxen.math.washington.edu/home/emil/VM/sage-lite-vm-a1.ova (412
MB)



mmarco

unread,
Nov 9, 2011, 11:17:03 AM11/9/11
to sage-devel
I have tried compressing it with 7z, and just got a gain of around 100
megs. I will try to take a look at the bdist option.

Soes the use of compressed filesystems slow things down?

Besides the size issue, do you have any other feedback?

Thanks

Emil Widmann

unread,
Nov 9, 2011, 12:10:56 PM11/9/11
to sage-devel
Hm ... I am downloading again, I have just a normal PC and the
previous download crashed my setup (filled my partition). Download
will need 1,5 hours.

Volker Braun

unread,
Nov 9, 2011, 12:32:29 PM11/9/11
to sage-...@googlegroups.com
On Wednesday, November 9, 2011 6:34:18 AM UTC-5, mmarco wrote:
The .ova file is 2 gigs big.

This is too big. I'm maintaining the "official"  virtual image and its only 1.4 gb, despite being a fairly standard Fedora install. Did you zero out the virtual disk before exporting? There is trash in the unused virtual disk sectors that impacts compression.

IMHO the most important thing is not cutting down the VM to the minimal size, but making it easily maintainable by having a script that spits out a new OVA without user interaction...


Emil Widmann

unread,
Nov 9, 2011, 1:06:09 PM11/9/11
to sage-devel
> Did you zero out
> the virtual disk before exporting? There is trash in the unused virtual
> disk sectors that impacts compression.
>
> IMHO the most important thing is not cutting down the VM to the minimal
> size, but making it easily maintainable by having a script that spits out a
> new OVA without user interaction...

Sure, must be bit trash on the virtual disk! I try to use flexible
virtual disks, they are slower in the beginning, but they will occupy
less space on the disk. Might be important for people who "just want
to try".

Of course you are right with the auto generation feature. Size is not
everything, but I saw the latest download statistics published by H.
Schilly on sage-marketing and the virtual images rank very prominent
(I think 5k downloads). For those who "just want to try" my guess is
"smaller size=less intimating".
I managed to split the compressed filesystem into sage and the base
distro, so its now a matter of copying in a new sage version to be up
to date again.

mmarco

unread,
Nov 9, 2011, 1:20:37 PM11/9/11
to sage-devel
I am also working on that. I am thinking about setting up another
guest OS that, when booted, fetches the last sage source, compiles it,
and copies it to the hard disk of the main VM, overwriting the
previous one.

mmarco

unread,
Nov 9, 2011, 1:21:58 PM11/9/11
to sage-devel
BTW, i use a flexible virtual disk. Would that benefit from the
zeroing out?

Volker Braun

unread,
Nov 9, 2011, 1:41:16 PM11/9/11
to sage-...@googlegroups.com
I take it you mean dynamically allocated virtual disks, which I'm using as well. I'm pretty sure that you need to manually zero it (also check out zerofree, though I opted for the simpler dd if=/dev/zero way). 


Emil Widmann

unread,
Nov 9, 2011, 3:11:42 PM11/9/11
to sage-devel

> Besides the size issue, do you have any other feedback?

OK :-) , finally I managed.
After long download import needs another 8 min on my machine.
Bootup, startup is fast. It works like a treat!

About the size
You have a 16 GB dynamically allocated disk
df -a command gives about 3.5 GB used

I checked in the VirtualBoxVMS Directory, the virtual disk size after
startup is 5.8 GB - so it might well be those non zeros.

Anyway I think 3.5 GB is not minimal, sizewise.
I found the sage folder is 2.3 GB including 380 MB source code.
Still 1.2 GB seems much for the os.
+ Compilers and Buildutils are installed.

I am currently running fslint tools on it. (http://www.pixelbeat.org/
fslint) which should give more info about file cruft.

Well, minor issue, localization - I have a german quertz keyboard.
Another minor issue is that the plotting of R is not supported
(missing X system, probably the same issue as in
http://groups.google.com/group/sage-windows/browse_thread/thread/3bb9d64cc6e18000)

cheers, thanks for sharing

William Stein

unread,
Nov 9, 2011, 3:26:40 PM11/9/11
to sage-...@googlegroups.com
On Wed, Nov 9, 2011 at 12:11 PM, Emil Widmann <emil.w...@gmail.com> wrote:
>
>> Besides the size issue, do you have any other feedback?
>
> OK :-) , finally I managed.
> After long download import needs another 8 min on my machine.
> Bootup, startup is fast. It works like a treat!
>
> About the size
> You have a 16 GB dynamically allocated disk
> df -a command gives about 3.5 GB used
>
> I checked in the VirtualBoxVMS Directory, the virtual disk size after
> startup is 5.8 GB - so it might well be those non zeros.
>
> Anyway I think 3.5 GB is not minimal, sizewise.
> I found the sage folder is 2.3 GB including 380 MB source code.
> Still 1.2 GB seems much for the os.
> + Compilers and Buildutils are installed.

Regarding size, a new "sage -strip" option in Sage is relevant:

http://trac.sagemath.org/sage_trac/ticket/10801

>
> I am currently running fslint tools on it. (http://www.pixelbeat.org/
> fslint) which should give more info about file cruft.
>
> Well, minor issue, localization - I have a german quertz keyboard.
> Another minor issue is that the plotting of R is not supported
> (missing X system, probably the same issue as in
> http://groups.google.com/group/sage-windows/browse_thread/thread/3bb9d64cc6e18000)
>
> cheers, thanks for sharing
>

> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

mmarco

unread,
Nov 9, 2011, 3:29:04 PM11/9/11
to sage-devel
Ok, after finding some files and directories that can be erased, and
zeroing out, i could strip the .ova file to 1.2 GB. The df command now
gives around 3.1 GB. Its one of the drawbacks of gentoo: you have a
lot of control of your system, but disk usage is high. Maybe there is
still room for uninstalling.


I am now uploading it to the server. It should be available in a few
hours.

This weekend i will work on the automatic building question.

Thanks for the feedback.

kcrisman

unread,
Nov 9, 2011, 3:37:14 PM11/9/11
to sage-devel


On Nov 9, 3:29 pm, mmarco <mma...@unizar.es> wrote:
> Ok, after finding some files and directories that can be erased, and
> zeroing out, i could strip the .ova file to 1.2 GB. The df command now
> gives around 3.1 GB. Its one of the drawbacks of gentoo: you have a
> lot of control of your system, but disk usage is high. Maybe there is
> still room for uninstalling.
>

I have a really dumb question. Do you need a VM player (e.g.,
VirtualBox, VMWare) to use this? Or is that included somehow? Maybe
this is obviously "yes" but I just didn't see it mentioned earlier in
the thread, sorry if it's noise.

- kcrisman

mmarco

unread,
Nov 9, 2011, 3:55:46 PM11/9/11
to sage-devel
Yes, you need it. It is done with VirtualBox. I don't have VMWare
installed, so i am not sure, but i guess you can import it.

Emil Widmann

unread,
Nov 9, 2011, 4:39:12 PM11/9/11
to sage-devel
> > I have a really dumb question.  Do you need a VM player (e.g.,
> > VirtualBox, VMWare) to use this?  Or is that included somehow?  Maybe
> > this is obviously "yes" but I just didn't see it mentioned earlier in
> > the thread, sorry if it's noise.
>
> > - kcrisman

I found Virtualbox a tad easier to use than Vmware. Virtualbox is 65
MB download (for Linux).
Normally you download binaries for a personal copy of the player which
you are free to use, but redistribution is not permitted.

However there is the Open Source Edition. I have never tried to
compile this and I don't know how it compares performance wise. But If
there would be a reasonable working windows build of this OSE version
I see the possibiliy to package VirtualBoxOSE + Sage VM, maybe a
little installer GUI and then we would have our sage for windows.

https://www.virtualbox.org/wiki/Licensing_FAQ

In Linux there is the kvm qemu option (virtualisation support is
included in the kernel via kvm). But we want to get those windows
users so skip that option.

> Regarding size, a new "sage -strip" option in Sage is relevant:
> http://trac.sagemath.org/sage_trac/ticket/10801

Praise for implementing "make micro-relase" - just what I needed.
btw, I read the comment on that track ticket

>It seems like the LiveCD folks have also worked on stuff like this...

made me smile, wish there would be "folks"

mmarco

unread,
Nov 9, 2011, 4:59:53 PM11/9/11
to sage-devel
In the download page of VirtualBox, there is a GPL binary for windows.

mmarco

unread,
Nov 10, 2011, 6:35:13 AM11/10/11
to sage-devel
Ok, the striped down 1.2 GB virtual machine is available in the same
link. Maybe some unneeded system utilities could still be removed, but
i wouldn't expect more than a few dozen MB gained from that.

I have noticed that, when running under virtualbox and closing saving
the state, everything continues to work perfectly after resuming the
state (in some other virtual machines i have tried, the network, for
example, stoped to work properly). So if in the manual of the windows
version of sage we state that way to close the VM as the standard,
bootup time is not that important.

mmarco

unread,
Nov 10, 2011, 6:40:50 AM11/10/11
to sage-devel
I forgot to mention that buiding sage from source writes the logs of
all the building process. Removing them saves a lot of disk space. I
think such a thing should also be included in the make micro_release
script.
Reply all
Reply to author
Forward
0 new messages