Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Virtualbox Gentoo Guests for Linux and Windows.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Wed Sep 25, 2013 7:47 am    Post subject: Virtualbox Gentoo Guests for Linux and Windows. Reply with quote

This is an update as of March 26, 2016.

If you want to quickly spin up a Gentoo VirtualBox x86 guest under Windows, or an amd64 guest under linux, here are virtual disk images that are ready to go. If the vdi file resides on a btrfs filesystem, you must mount that disk with the nodatacow option. This is a little-known problem with VirtualBox and btrfs.

I hope it will save you some time. These are Gentoo guests with complete MATE desktop environments, pulseaudio, flash, and CD support. I have used mate-1.12 from the mate-de-gentoo overlay.

There are two users: larry and root. The password is gentoo.

Comments are welcome.

Instructions:

1. On your host computer, download VirtualBox and VirtualBox Extension Pack. I used VirtualBox 5.0.16.

2. If you wish, enable virtualization in your BIOS. The Gentoo image supplied here supports multiple cpus, although it will work with just one cpu.

3. Download the compressed disk image:

For Windows Hosts: https://www.dropbox.com/s/q8i9r7dqgfw5xs4/Gentoo.zip?dl=0 (1.2 GB)
For Linux Hosts : https://www.dropbox.com/s/knp5u2iv18xgu5r/Gentoo.vdi.xz?dl=0 (1.1 GB)

4. Verify the downloaded file.

Code:
$ sha1sum Gentoo*
db1b3080e31aca003ab6ac56441019e563e9aaa7  Gentoo.zip
671c58a10a34734971ef5264bcb27b1a4046d936  Gentoo.vdi.xz


5. Decompress the VDI file and place it in the VirtualBox VMs subdirectory in your home directory.

6. Create a new Virtual Machine in VirtualBox. The settings I used are as follows:


  • General:

    • Basic:
      Name: Gentoo x86 (amd64 for a Linux host)
      Type: Linux
      Version: Gentoo
    • Advanced:
      Shared Clipboard: Enabled Bi-directional
      Drag-Drop: Enabled Bi-directional
      Removable Media: Check Remember Runtime Changes
      Mini Toolbar: Check Show in Fullscreen
      Uncheck Show at Top of Screen

  • System:

    • Motherboard:
      Base Memory: 3000 MB
      Boot Order: CD, then HardDisk
      Chipset: ICH9. (this is important, or the machines will kernel panic.)
      Extended Features:

      • Enable IO APIC


    • Processor:
      Four cpus.
      Execution cap 100%
      Enable PAE/NX is checked
    • Acceleration:
      Enable VT-x/AMD-V is checked
      Enable Nested Paging is checked

  • Display
    Video Memory: 20MB
    Monitor Count: 1
    Enable 3D Acceleration is checked.
  • Storage
    You need to add the vdi file you downloaded as a disk under a SATA controller (type AHCI).
    There should be an IDE controller of type PIIX4 for the CD drive. Use host I/O cache should be checked.

  • Audio
    Enable Audio is checked
    Host Audio Driver is Windows DirectSound
    Audio Controller is ICH AC97

  • Network
    Enable Network Adapter 1, attached to NAT.
    Advanced: Adapter type Intel PRO 1000MT Desktop (82540EM)
    Cable connected is checked.

  • Serial ports: Everything is unchecked. No support.

  • USB:
    Enable USB Controller is checked.
    Enable USB 2.0 (EHCI) controller is checked.


7. Start the virtual machine.

8. Press F1 at the login prompt to select MATE. The password for the users root and larry is gentoo.


Last edited by ycUygB1 on Wed Apr 13, 2016 1:04 am; edited 27 times in total
Back to top
View user's profile Send private message
hagar-dunor
n00b
n00b


Joined: 26 Apr 2012
Posts: 39

PostPosted: Tue Oct 01, 2013 12:55 pm    Post subject: Reply with quote

Hi, maybe it would be worth to merge topics ? https://forums.gentoo.org/viewtopic-t-964410.html

One comment : your virtual drive looks huge, have you tried to fill your partitions with zeros before compressing ?

For each partition :

Code:
dd if=/dev/zero of=dump
rm dump


Cheers


Last edited by hagar-dunor on Tue Oct 01, 2013 5:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Tue Oct 01, 2013 4:29 pm    Post subject: Reply with quote

Thanks for your tip about zeroing out unused space. Now the zip file is half of what it was before.

Regarding merging, I'll leave that up to the moderators.
Back to top
View user's profile Send private message
hagar-dunor
n00b
n00b


Joined: 26 Apr 2012
Posts: 39

PostPosted: Tue Oct 01, 2013 5:40 pm    Post subject: Reply with quote

Still seems too fat. A full gnome virtual image should weight between 700 and 800 MB. Some additional tips I use for my virtual image :

-Wipe /usr/portage/distfiles
-"make clean" in /usr/src/linux
-Don't forget to zero unused space on /boot partition if it's a partition on it's own, same for swap if it happened to be used.

About thread merging, I was thinking of something that we should initiate, a common thread to host all gentoo virtual images in one place. But it's just an idea.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Wed Oct 02, 2013 9:28 am    Post subject: Reply with quote

Thanks again for your pointers. Now the zip file is 1.05 GB and the VDI file is 8 GB. A few useful commands follow, mostly for my own reference. Users shouldn't need these commands:

Sometimes VirtualBox will refuse to mount the vdi file if it has previously encountered another vdi with the same identifier.

Code:
VBoxManage.exe internalcommands sethduuid hd.vdi


Code:
swapoff /dev/sda2
dd if=/dev/zero of=/dev/sda2
mkswap /dev/sda2


boot into runlevel 1 by placing init 1 at the end of the kernel line in grub.

Code:
mount -o remount,ro  /
zerofree /dev/sda1
shutdown -h now


To minimize the size of the disk image.

Code:
VBoxManage modifyvdi hd.vdi compact


Last edited by ycUygB1 on Sun Dec 07, 2014 2:41 pm; edited 5 times in total
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Sat Jul 26, 2014 4:31 pm    Post subject: Reply with quote

Update for 2014. See original post.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Tue Oct 14, 2014 4:35 pm    Post subject: Reply with quote

Update to include an image for Linux hosts. This is useful if you quickly want a fresh Gentoo environment for testing and lxc won't cut it.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Sat Mar 26, 2016 4:53 pm    Post subject: Reply with quote

Update for 2016. See original post.
Back to top
View user's profile Send private message
electroman90
n00b
n00b


Joined: 28 Mar 2016
Posts: 3

PostPosted: Tue Mar 29, 2016 9:45 pm    Post subject: Reply with quote

I'm using your build for Linux hosts on my CentOS machine at work. I was going to set up Gentoo in VBox myself right before finding this and it seems to be put together quite nicely. Thanks.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Tue Mar 29, 2016 9:51 pm    Post subject: Reply with quote

Thanks. Let me know if you have any feedback.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum