Sie sind auf Seite 1von 3

Using Sage on Windows via Virtual Box

Bart Post
27 June 2013

Installing Sage on Windows

Information on installing Sage on windows can be found here: http://www.sagemath.org/


download-windows.html.

What is Virtual Box?

Virtual Box (VB) is a computer program that can simulate hardware. In other words, VB
can create a virtual computer system, having virtual RAM, processors, harddisks etc. Since
this virtual computer is a computer it will need an operating system to run it. In simple
terms: that operating system will be Sage. This makes it possible to run Sage (based on
a Unix core) inside windows. The VB will forward your mouse and keyboard input from
windows towards Sage. Normally this is done automatically.
Note that it is possible to have VirtualBox create multiple virtual machines at te same
time. This however will influence your computers speed and memory usage since each virtual
machine represents a computer with an operating system.

Configuring Virtual Box

Start Virtual Box. Then select Sage-x.y and then click settings (button with a yellow gear,
dutch: Instellingen).

3.1

Ctrl+c, Ctrl+v

By default, you can not Ctrl+c in windows and then Ctrl+v in Sage. This is how to solve
this.
1. Go to General (Dutch: Algemeen)
2. Go to Advanced (Dutch: Geadvanceerd)
3. At Shared Clipboard (Gedeeld Klembord), select Bidirectional (Bidirectioneel).
1

You can also enable Drag and Drop in the same menu, same tab.

3.2

Adding more RAM

Since VB creates a virtual computer, you can modify the amount of RAM that Sage can use.
By default it is set to 512MB, depending on your own system. You can modify the virtual
hardware here:
1. Go to System (Systeem)
2. Go to Motherboard (Moederbord)
WARNING: The RAM given to your virtual machine can not be used by your windows
system anymore. Be sure to leave enough RAM to your windows machine.
You can also change the amount of processors, but this can only be done if your windows
system supports virtual processors. If you dont know if it does; leave these settings as they
are.

Configuring Sage

Since Sage is a virtual machine, which is a computer, it has its own file structure. You
cannot easily reach this with windows. However, there is a way to get your Sage worksheet
in windows. Once Sage is running in its virtual environment you can start to execute code.

4.1

Directly on Sage

If you have started Sage then you will have a windows frame titled Sage-x.y [Running] Oracle VM VirtualBox. Within this frame you can create new worksheets, execute code
etc. However, you can not yet get these worksheets to windows. If you wish to do that,
open a worksheet and then click Publish. You can find the Publish button in the top
right menu, beneath the save, save and quit and discard and quit buttons. To make
life easy, also select the Automatically re-publish when changes ar made option before you
publish. Then select Yes. In the next section we will see how to get the worksheets to
windows.

4.2

Working on Sage via Windows

If you have Sage running inside VB, we can also access Sage in Windows. Before we can do
that we need to create a user for Sage. Follow these steps to create a user in Sage:
1. In Sage, go to Settings. You can find Settings in the very most top right menu, in
between Log and Help.
2. Go to Manage Users.
2

3. Click Add User.


4. Type a user name and click Create Account.
5. IMPORTANT: Sage will now show a password for this account. Make sure to copy
this password, you will obviously need it.. You can later change this password.
Now we have a user. DO NOT SHUT DOWN SAGE. However, do go to your windows
system and start your favorite webbrowser (Chrome, IE, Firefox, Safari, Operah etc). Then
follow these steps:
1. In your address bar, type http://localhost:8000
2. Log in using your username and password from the Sage account created in the steps
above.
3. Nou you can use Sage via this webbrowser, allowing you to download your worksheets
to you windows system.
You can view your published worksheets by clicking Published in the top right menu.
Also, you can create your own worksheets, execute code and download the results. Note that
you can now execute code in two ways: directly on Sage or via your webbrowser in Windows.
However, if you want to download your worksheets that you created directly in Sage you will
first need to publish them and then acces them via your webbrowser in Windows.

4.3

Why does this work?

Sage will act as a webserver on your computer. That means that you can acces Sage via the
internet. The difference however is that you will never really go over the real internet since
the Sage webserver is on your own computer. You can however acces Sage on your computer
via another computer if you know your own computers IP (Internet Protocol) address. To
do that, the other computer needs to be in the same network. Then, on the other computer,
type http://[ipadress of your computer]:8000 as web address. You can find your IP-address
as follows:
1. In windows, go to Start.
2. In the search bar type cmd + enter.
3. A windows command screen will show up.
4. Type ipconfig/all
5. A whole bunch of info wil show up. Look for Ipv4-Adres. The number behind is your
computers IP address.

Das könnte Ihnen auch gefallen