LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-01-2015, 07:11 AM   #16
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065

Refer to pages 37-42 of the User Manual (it's in /opt/VirtualBox/UserManual.pdf).

You install VirtualBox as root, you install one or more virtual machines as "you." The installer checks for the group vboxusers and, if it does not exist, the installer creates it but you must add your username to the group manually (you only do this once, installing an updated version of VirtualBox will not overwrite the group entry).

You install virtual machines as "you," not as root. By default, virtual machines are added in your home directory tree. You can create a partition on your hard drive or on a separate disk drive and install your virtual machines there.

For example, I have a partition /var/lib/virtual where virtual machines live. I only have one install at this time and it's Win7. The tree looks like this:
Code:
tree /var/lib/virtual
/var/lib/virtual
 HardDisks
 Machines
  Win7
      Logs
       VBox.log
       VBox.log.1
       VBox.log.2
       VBox.log.3
      Win7.vbox
      Win7.vbox-prev
      Win7.vdi
 lost+found
The mount point, virtual, has this permission mask
Code:
drwxrwxr-x  5 root       vboxusers 4096 Mar 14  2011 virtual/
That is,
Code:
chmod 775 /var/lib/virtual
so I can read and write to it.

The content of /var/lib/virtual looks like
Code:
 ls -al /var/lib/virtual
total 32
drwxrwxr-x  5 root  vboxusers  4096 Mar 14  2011 ./
drwxr-xr-x 36 root  root       4096 May  1 04:40 ../
drwxr-xr-x  2 trona users      4096 Mar  8  2014 HardDisks/
drwxr-xr-x  3 trona users      4096 Mar  8  2014 Machines/
drwx------  2 root  vboxusers 16384 Mar 13  2011 lost+found/
Note that the directory HardDisks is no longer used by VirtualBox and, because it's a partition, there is a lost+found directory (you won't have lost+found in your home directory). I just leave the directory there, there's nothing in it

Now, I own all the directories and files in the Machines directory and the group is users. That's normal. What gives me permission to write is the parent directory, /var/lib/virtual which is owned by root, group vboxusers and the mode 775. That's automatically done by VirtualBox when, as you, you create a virtual machine. Keep in mind that this tree is on a separate partition, not in my home directory. Look at the tree that was created in your home directory and see what it looks like, particularly what the root directory of the virtual machine looks like (it'll be in your home and its group should be vboxusers). That's not your home directory, it's the directory VirtualBox created when you added a virtual machine in your home directory (and I don't remember what it's named, you'll need to look, it might be a dot-directory). I haven't ever created a virtual machine in my home directory, so I'm at a loss here about the tree structure when you do that.

Be sure to take a little time and scan through the User Manual.

Hope this helps some.

Last edited by tronayne; 05-01-2015 at 07:19 AM.
 
4 members found this post helpful.
Old 05-01-2015, 08:09 AM   #17
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
This what makes me thing its a Slackware specific config because following their (VirtualBox) manual does not work. I add my user to the group as documented but virtualbox won't even start so I haven't even created any guests yet or told it where I want to put them. Unless I do logoff and back in as root then run it and it works fine.
 
Old 05-01-2015, 09:09 AM   #18
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Quote:
Originally Posted by enine View Post
This what makes me thing its a Slackware specific config because following their (VirtualBox) manual does not work. I add my user to the group as documented but virtualbox won't even start so I haven't even created any guests yet or told it where I want to put them. Unless I do logoff and back in as root then run it and it works fine.
Well, no, it's not Slackware-specific: if you installed VirtualBox by, as root, executing, for example the 64-bit VirtualBox-4.3.26-98988-Linux_amd64.run and did not get any errors, you should be good to go. That install file is from https://www.virtualbox.org/wiki/Linux_Downloads All Distributions (pick i386 or AMD64 depending on your system).

You will not be able to execute VirtualBox logged in as "you' until you've added your user account name to vboxuser with, as root
Code:
usermod -a -G vboxusers username
Now, you do need to check /etc/group and make sure that you have one line similar to this one:
Code:
fgrep vboxusers /etc/group
vboxusers:x:102:username
where username is your user name.

Then, you can start VirtualBox (not as root) and install the Extension Pack from the link on the Downloads page (https://www.virtualbox.org/wiki/Downloads -- up one from the VirtualBox 4.3.26 for Linux page).. You want the All Supported Platforms link. You really do want the Extension Pack (for USB support and other Good Things).

You do not want to run VirtualBox as root, you want to run it as "you." Things will get really, really screwy if you run it as root or install a virtual machine as root. You do not want to establish a user account for vboxusers. You can, if you like create a user account for using VirtualBox (that means log off as you, log on as that user... but why? It's supposed to be used by you.)

When you start VirtualBox you'll have the VirtualBox Manager window displayed (that's where you install the Extension Pack). From there you can create one or more virtual machines (guests). If you're going to install, say, Win7, one of the things you'll do is allocate disk for it -- the suggested default disk size for Win7 is 25G. Don't use less if you actually are going to use it. Save yourself a lot of trouble and fooling around by giving it a lot more space than just a base install.

If you've started VirtualBox as root, you've probably got the local (in your home directory) tree owned by root. Check that and change it to your username so you can read and write to it. The default directory (in your home directory) is VirtualBox\ VMs (that's how it appears when you use ls; it's because of the space character).

Hope this helps some.

Last edited by tronayne; 05-01-2015 at 10:55 AM. Reason: Added a little clearer explanation
 
3 members found this post helpful.
Old 05-01-2015, 12:52 PM   #19
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by tronayne View Post
Well, no, it's not Slackware-specific: if you installed VirtualBox by, as root, executing, for example the 64-bit VirtualBox-4.3.26-98988-Linux_amd64.run and did not get any errors, you should be good to go. That install file is from https://www.virtualbox.org/wiki/Linux_Downloads All Distributions (pick i386 or AMD64 depending on your system).

You will not be able to execute VirtualBox logged in as "you' until you've added your user account name to vboxuser with, as root
Code:
usermod -a -G vboxusers username
Now, you do need to check /etc/group and make sure that you have one line similar to this one:
Code:
fgrep vboxusers /etc/group
vboxusers:x:102:username
where username is your user name.

Then, you can start VirtualBox (not as root) and install the Extension Pack from the link on the Downloads page
So those are the exact steps I did this time as well as the past. Download from my account and make executable. Su - root and install, add my user to the vboxusers group. Then when I try to run virtualbox as myself it throws the error that I'm not running it as root. This always worked before but now doesn't
 
  


Reply

Tags
salix, virtualbox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Virtualbox in Slackware 14.0 gabytf Slackware 3 12-13-2012 09:33 AM
Installing VirtualBox TroN-0074 Linux - Newbie 6 02-04-2012 09:08 PM
need help installing virtualbox baronobeefdip Linux - Software 2 05-18-2011 05:52 PM
installing ose virtualbox Fred Caro Linux - Newbie 3 06-20-2008 06:21 PM
Help installing VirtualBox 449 Linux - Software 1 02-15-2008 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration