# Bashing sudo

**URL:** <https://forums.suse.com/t/bashing-sudo/23596>\
**Category:** Chatting over the Back Fence\
**Created:** [February 7, 2013, 3:30am UTC](https://forums.suse.com/t/bashing-sudo/23596 "2013-02-07T03:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)\
**Post date:** [February 7, 2013, 3:30am UTC](https://forums.suse.com/t/bashing-sudo/23596/1 "2013-02-07T03:30:23Z")

</div>

Hi,

I tried to save a client a buck or two and, as usual, I lose.

I need to run 2 virtual machines on a computer. The host is openSUSE  
12.2. I am using vmplayer which only allows 1 VM. I setup 2 accounts  
and run vmplayer in each account which works but is a little unwieldy.

So then in a terminal in User1’s account I “su - user2” then run  
vmplayer. This works too and is a little less unwieldy.

Now I want to script this so it will run automagicly. sudo seems to be  
lacking or I don’t understand.

sudo -u user2 -H /user/bin/vmplayer  
user2’s password:  
DISPLAY is not set,

So I need to set DISPLAY and pass in the password.

After this is fixed I get to go home and barbeque a pizza.

Have a nice day.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 7, 2013, 3:42am UTC](https://forums.suse.com/t/bashing-sudo/23596/2 "2013-02-07T03:42:17Z")

</div>

> [@](#):
>
> On Thu 07 Feb 2013 01:30:23 AM CST, Bob Crandell wrote:
> 
> Hi,
> 
> I tried to save a client a buck or two and, as usual, I lose.
> 
> I need to run 2 virtual machines on a computer. The host is openSUSE  
> 12.2. I am using vmplayer which only allows 1 VM. I setup 2 accounts  
> and run vmplayer in each account which works but is a little unwieldy.
> 
> So then in a terminal in User1’s account I “su - user2” then run  
> vmplayer. This works too and is a little less unwieldy.
> 
> Now I want to script this so it will run automagicly. sudo seems to be  
> lacking or I don’t understand.
> 
> sudo -u user2 -H /user/bin/vmplayer  
> user2’s password:  
> DISPLAY is not set,
> 
> So I need to set DISPLAY and pass in the password.
> 
> After this is fixed I get to go home and barbeque a pizza.
> 
> Have a nice day.

Hi  
Add it to the sudoers file via visudo…

```auto
user2 ALL = NOPASSWD: /usr/bin/vmplayer
```

Does the system cpu support kvm (eg vt flag)? If so look at using  
kvm…or esxi?

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 12.2 (x86\_64) Kernel 3.4.11-2.16-desktop  
up 11:54, 3 users, load average: 0.05, 0.04, 0.05  
CPU IntelÂ® i5 CPU M520@2.40GHz | GPU IntelÂ® Ironlake Mobile

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)\
**Post date:** [February 7, 2013, 8:29pm UTC](https://forums.suse.com/t/bashing-sudo/23596/3 "2013-02-07T20:29:33Z")

</div>

Good heavens… is there a reason you don’t just use a better product,  
like VirtualBox? Also free, cross-platform, allows any number of VMs…  
downside?

Good luck.
