[GUIDE] VirtualBox Set-Up (MORE TO COME!)

Search This thread

Thatgrass

Senior Member
Jan 14, 2012
1,678
538
XDA-Developers
Hello there,

This thread isn't finished yet. It's a Work In Progress thread, for setting up a working Environment for Developing Apps and also a quick guide for developing ROMs from source. I hope to see you again when there are more updates!

Are you on Windows or OS X and do you want to develop for Android with(out) dual-boot or installing a whole new operating system on your PC? Well, then you have come to the right place!
In this guide I'am going to show you how to set-up a virtual machine with Java, the Android SDK, the Eclipse IDE and the Android Source Code.
I will be using Windows in this tutorial, but you can use pretty much every OS out there; The setup is pretty much the same. I use Ubuntu 12.10 for the VirtualBox guide and 12.04 for the other guides in this thread, but you can use every version of Ubuntu you'd like.
So let's get started.

1. Setting up VirtualBox (You can skip this step if you want to develop apps with your current OS, or if you don't want to build ROMs from source code)

VirtualBox is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. Secondly, it extends the capabilities of your existing computer so that it can
run multiple operating systems (inside multiple virtual machines) at the same time. So, for example, you can run Windows and Linux on
your Mac, run Windows Server 2008 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install
and run as many virtual machines as you like -- the only practical limits are disk space and memory.

VirtualBox is deceptively simple yet also very powerful. It can run everywhere from small embedded systems or desktop class machines
all the way up to datacenter deployments and even Cloud environments.

a. Go to virtualbox.org and select your proper operating system, in my case this will be the Windows Hosts download.

1screena.jpg

b. Once downloaded, run the installer and leave all boxes ticked as they are and hit ''Install'' at every pop-up.

2screenl.jpg

c. Now go to ubuntu.com and download the 32 or 64 bit image. I'd recommend 32 bit, since it'll run smoother in VirtualBox, but if your intention is to develop ROMs, you should pick the 64 bit.

d. When it has downloaded, open VirtualBox and hit the ''New'' button in the upper left corner. Call it Ubuntu12.10 and make sure it looks like the following.

3screen.jpg

e. Add at least 1000MB of RAM and if you can spare more, but make sure it's not more than half of your host PC RAM, otherwise you're PC could crash. Then click ''Next".

4screenp.jpg

f.
Now choose ''Create new Virtual Harddisk and hit ''Next'', then choose ''VDI'' and then the ''Dynamic'' option. Now choose you amount of storage in the Virtual Harddisk, I'd recommend at least 40GB, but if you've in mind developing from source, I should go for 70GB or more. After that, click the ''Create'' button.

5screeno.jpg

g. Click on the Ubuntu12.10 tab on the left side and then hit ''Storage'' in the right pannel.

6screens.jpg

h. Now hit ''Empty'' button underneath ''Controller IDE'', click in the right pannel the disk image and click ''Choose virtual CD/DVD-Image''

7screen.jpg

i. Navigate to the Ubuntu12.10 Image you've downloaded earlier and open it. After that, hit ''OK'' on the downright corner.

j. Now click the option ''Display'', in the same tab as in step ''g''. Move the ''Videomemory'' all the way up to the top and hit ''OK'' again.

k. Just hit ''Start'' and Ubuntu should right boot to the installer screen.

8screen.jpg

l. First pick your language on thee right side, then we want to ''Install Ubuntu''.

9screen.jpg

m.
Tick the boxes ''Download updates while installing'' and ''Install this third-party software''. Make sure you are connected to the internet and your good to go; hit ''Continue''.

10screen.jpg

n. Leave the installation type on ''Erase Disk and install Ubuntu'', don't worry, this will only wipe your Virtual Harddisk. Hit ''Continue'' again; this will start the installation process.

11screens.jpg

o. While installing, Ubuntu will ask you for your location, keyboard layout, name and give you some information about Ubuntu 12.10. For me this installation took around 50 minutes.

12screen.jpg

p. If it says ''Remove Disk please'' or something simular, just press ''Enter''. When the VM has booted up, login, then click at the top ''Devices''. At the bottom it says:''Install Guest additions..''. Click it and follow the instructions on screen. It'll auto-reboot.

13screen.jpg

q. The last step: Search for the programm: ''Software Updater'' in ''Dash Home''. Open it and it will check for updates, then click ''Install now''. This will install the latest Ubuntu updates.

14screen.jpg

Now you have a complete Ubuntu OS running in VirtualBox. Congratulations!
 
Last edited:
D

Deleted member 4303594

Guest
I don't know about OS X but eclipse works in both Linux and windows. Why would anyone want to setup virtualbox for app development?
 

Thatgrass

Senior Member
Jan 14, 2012
1,678
538
XDA-Developers
I don't know about OS X but eclipse works in both Linux and windows. Why would anyone want to setup virtualbox for app development?

If you are a developer you can definately use linux, because of the android and linux integration; when developing for Android, Linux provides more features than Windows or OS X does.

Thatgrass.
 
I don't know about OS X but eclipse works in both Linux and windows. Why would anyone want to setup virtualbox for app development?

My Windoze side is really just for gaming & a bit of photoshop work. I much prefer developing on the Linux side for ease of use, especially with command line stuff. It all just works 'better'. I've been using Ubuntu 12.04 64bit with Eclipse Juno as a guest on my hosting Win 7 machine for over a year now. I find it much better to compartmentalize my work, especially since I routinely reformat my win partition for various reasons.
 
  • Like
Reactions: ayysir

MacDegger

Retired Recognized Developer
Dec 20, 2008
174
26
No, really, please tell me what, if any, improvements there are in developing in *nix over windows or osx?

I develop in osx at work and windows at home, and the only differences I've found are really in the underlying OS features (god, Finder SUCKS!). OSX does have a better, one stop ADT/Eclipse install, but that's it. What does *nix offer?

The only thing a VM can offer is using it to run android itself, so you don't need the emulator, but I think that's a bit of hassle for no improvement.

But if there are reasons, I really want to know! I'm always up for a better workflow.
 

Sybregunne

Senior Member
Jan 24, 2011
983
1,128
Currently in Singapore
No, really, please tell me what, if any, improvements there are in developing in *nix over windows or osx?

I develop in osx at work and windows at home, and the only differences I've found are really in the underlying OS features (god, Finder SUCKS!). OSX does have a better, one stop ADT/Eclipse install, but that's it. What does *nix offer?

The only thing a VM can offer is using it to run android itself, so you don't need the emulator, but I think that's a bit of hassle for no improvement.

But if there are reasons, I really want to know! I'm always up for a better workflow.

Development environments are really up to the developer. I personally never developed in a mac os environment, I am just too inexperienced with mac os, I use my mac basically for its garage band application.

That said, I prefer linux when developing mainly for the control it gives me with regards to the total environment as opposed to windows very restricted nature. One feature I like with linux is the ability to overclock the cpu without restarting for when compiling especially custom kernels. Another is the ability to use high-end graphics card gpu to aide in compiling process. (http://hackaday.com/2012/12/14/leveraging-the-gpu-to-accelerate-the-linux-kernel/) The ability to create a chrooted environment to isolate your toolchains. Many more actually but mostly unrelated to android app development. Best reason so far is you can use an outdated machine to dev with linux coz it's free and supports some ancient machines.

Edit:
@MacDegger: Mac and linux are like distant relatives. So it's really not much difference. But if you're up to it installing a virtual linux machine might give you the chance to try the environment and see for yourself if there are benefits for your workflow.
 
Last edited:

trevd

Inactive Recognized Developer
Jul 19, 2011
895
1,271
Hull
Samsung Galaxy Tab 4
Hi Folks

The ability to create a chrooted environment to isolate your toolchains. Many more actually but mostly unrelated to android app development.

I was doing that until very recently, It became a bit of a pain however, Having to basically install an OS and set the user(s) , It leave my mount points in a state and plus I use a lot of bash aliases so they all where messed up as well.

There's another way! :D use update-alternatives to set up a gcc with g++ slave for any version of the toolchain you want, Install them all if you want and some cross compiler to boot. It makes cross compiling as easy as typing gcc and also makes compiling against the androideabi using standard make file "fun" as well

http://askubuntu.com/questions/182027/how-to-use-gcc-4-7-in-place-of-4-6-ubuntu-12-04

The links for 12-04 , it's good for 12-10 , should be good for any really , It's linux init' :)

Here's my list
Code:
  Selection    Path                                                                                     Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-4.2                                                                          80        auto mode
  1            /media/android/build/toolchains/android-arm-standalone/bin/arm-linux-androideabi-gcc      60        manual mode
  2            /media/android/build/toolchains/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc   60        manual mode
  3            /usr/bin/arm-linux-gnueabi-gcc-4.7                                                        40        manual mode
  4            /usr/bin/gcc-4.2                                                                          80        manual mode
  5            /usr/bin/gcc-4.4                                                                          40        manual mode
  6            /usr/bin/gcc-4.5                                                                          60        manual mode
  7            /usr/bin/gcc-4.6                                                                          60        manual mode
* 8            /usr/bin/gcc-4.7                                                                          40        manual mode
  9            /usr/bin/x86_64-unknown-linux-gnu-gcc-4.8.0                                60        manual mode

I just set a bash alias called setgcc like this "sudo update-alternatives --config gcc" , combine that with a java-5 install which automatically sets up alternatives and you can build any version of android you like all from the comfort of Lubuntu 12.10 ......Just for s**ts and giggles I built version 1.0 ( manifest ) after stumbling on the manifest file, seems google rebased and dropped some early branches after the kernel.org hack, were as the down stream mirrors obviously didn't!

LOL, All of that's a little OT so I'll close by saying you can do all this on virtual box! :p
 

SpaceCaker

Senior Member
Mar 26, 2011
13,545
10,904
netherlands
www.youtube.com
i still like VMware Player better'

because it wont use like 100 GB ( for linux ) in once

it will have a max of 100
and will reshape its hdd according to the data you have so you wont have lost space :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    Hello there,

    This thread isn't finished yet. It's a Work In Progress thread, for setting up a working Environment for Developing Apps and also a quick guide for developing ROMs from source. I hope to see you again when there are more updates!

    Are you on Windows or OS X and do you want to develop for Android with(out) dual-boot or installing a whole new operating system on your PC? Well, then you have come to the right place!
    In this guide I'am going to show you how to set-up a virtual machine with Java, the Android SDK, the Eclipse IDE and the Android Source Code.
    I will be using Windows in this tutorial, but you can use pretty much every OS out there; The setup is pretty much the same. I use Ubuntu 12.10 for the VirtualBox guide and 12.04 for the other guides in this thread, but you can use every version of Ubuntu you'd like.
    So let's get started.

    1. Setting up VirtualBox (You can skip this step if you want to develop apps with your current OS, or if you don't want to build ROMs from source code)

    VirtualBox is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. Secondly, it extends the capabilities of your existing computer so that it can
    run multiple operating systems (inside multiple virtual machines) at the same time. So, for example, you can run Windows and Linux on
    your Mac, run Windows Server 2008 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install
    and run as many virtual machines as you like -- the only practical limits are disk space and memory.

    VirtualBox is deceptively simple yet also very powerful. It can run everywhere from small embedded systems or desktop class machines
    all the way up to datacenter deployments and even Cloud environments.

    a. Go to virtualbox.org and select your proper operating system, in my case this will be the Windows Hosts download.

    1screena.jpg

    b. Once downloaded, run the installer and leave all boxes ticked as they are and hit ''Install'' at every pop-up.

    2screenl.jpg

    c. Now go to ubuntu.com and download the 32 or 64 bit image. I'd recommend 32 bit, since it'll run smoother in VirtualBox, but if your intention is to develop ROMs, you should pick the 64 bit.

    d. When it has downloaded, open VirtualBox and hit the ''New'' button in the upper left corner. Call it Ubuntu12.10 and make sure it looks like the following.

    3screen.jpg

    e. Add at least 1000MB of RAM and if you can spare more, but make sure it's not more than half of your host PC RAM, otherwise you're PC could crash. Then click ''Next".

    4screenp.jpg

    f.
    Now choose ''Create new Virtual Harddisk and hit ''Next'', then choose ''VDI'' and then the ''Dynamic'' option. Now choose you amount of storage in the Virtual Harddisk, I'd recommend at least 40GB, but if you've in mind developing from source, I should go for 70GB or more. After that, click the ''Create'' button.

    5screeno.jpg

    g. Click on the Ubuntu12.10 tab on the left side and then hit ''Storage'' in the right pannel.

    6screens.jpg

    h. Now hit ''Empty'' button underneath ''Controller IDE'', click in the right pannel the disk image and click ''Choose virtual CD/DVD-Image''

    7screen.jpg

    i. Navigate to the Ubuntu12.10 Image you've downloaded earlier and open it. After that, hit ''OK'' on the downright corner.

    j. Now click the option ''Display'', in the same tab as in step ''g''. Move the ''Videomemory'' all the way up to the top and hit ''OK'' again.

    k. Just hit ''Start'' and Ubuntu should right boot to the installer screen.

    8screen.jpg

    l. First pick your language on thee right side, then we want to ''Install Ubuntu''.

    9screen.jpg

    m.
    Tick the boxes ''Download updates while installing'' and ''Install this third-party software''. Make sure you are connected to the internet and your good to go; hit ''Continue''.

    10screen.jpg

    n. Leave the installation type on ''Erase Disk and install Ubuntu'', don't worry, this will only wipe your Virtual Harddisk. Hit ''Continue'' again; this will start the installation process.

    11screens.jpg

    o. While installing, Ubuntu will ask you for your location, keyboard layout, name and give you some information about Ubuntu 12.10. For me this installation took around 50 minutes.

    12screen.jpg

    p. If it says ''Remove Disk please'' or something simular, just press ''Enter''. When the VM has booted up, login, then click at the top ''Devices''. At the bottom it says:''Install Guest additions..''. Click it and follow the instructions on screen. It'll auto-reboot.

    13screen.jpg

    q. The last step: Search for the programm: ''Software Updater'' in ''Dash Home''. Open it and it will check for updates, then click ''Install now''. This will install the latest Ubuntu updates.

    14screen.jpg

    Now you have a complete Ubuntu OS running in VirtualBox. Congratulations!
    1
    Reserved for further updates
    1
    I don't know about OS X but eclipse works in both Linux and windows. Why would anyone want to setup virtualbox for app development?

    My Windoze side is really just for gaming & a bit of photoshop work. I much prefer developing on the Linux side for ease of use, especially with command line stuff. It all just works 'better'. I've been using Ubuntu 12.04 64bit with Eclipse Juno as a guest on my hosting Win 7 machine for over a year now. I find it much better to compartmentalize my work, especially since I routinely reformat my win partition for various reasons.
    1
    Yes in virtualbox. i see this in your scrennshot http://d.pr/i/SUGQ

    Exactly the same thing, but dont use the ubuntu image but download an image from android-x86.com. ;)

    Sent from my GT-N7000 using xda app-developers app
    1
    I have been Dual Booting for some time now but the ease of a VB and not having to reboot and leave an OS is appealing. I have been thinking about trying VB but then again I do have another older laptop that I have Ubuntu 12.10 setup on anyways. I just hate having two laptops going at the same time.

    Great tutorial, I will sure give this a try tonight.