You are not logged in.

#1 2014-09-12 13:26:51

brapodam
Member
Registered: 2014-09-12
Posts: 2

[SOLVED] Running a VM at Startup in Separate X Server

Hi,

I want to run a VM at startup in another X server (so I can switch to it using Ctrl+Alt+F8), but I can't seem to figure out how to do it. I've Googled this and come across some instructions on how to do it, but it didn't work for me.

What I try to do is to set up my .xinitrc this way:

#!/bin/bash

# Dbus fix
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
    eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi

numlockx &
xset s off

/usr/bin/xdg-user-dirs-update

# start xfce
startxfce4 

# Start Win7 Virtual Machine
startx ./vbox.sh -- :1 -vt8

where vbox.sh is a script that I have placed in my home directory:

#!/bin/bash

virtualbox --startvm "Windows7" --fullscreen

I've also tried placing the startx ./vbox.sh before the startxfce4 command, but all it does is make my computer boot slower and I still don't have the VM running in my ctrl+alt+f8

Last edited by brapodam (2014-09-13 10:35:35)

Offline

#2 2014-09-12 14:06:19

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Running a VM at Startup in Separate X Server

I would add a script into XFCE's session startup.

Last edited by brebs (2014-09-12 14:07:48)

Offline

#3 2014-09-13 01:18:54

brapodam
Member
Registered: 2014-09-12
Posts: 2

Re: [SOLVED] Running a VM at Startup in Separate X Server

brebs wrote:

I would add a script into XFCE's session startup.

Didn't work for me either.

Anyway, I gave up trying to run my VM in a separate X session. I just installed wmctrl, run the VM at startup and switch it to another workspace.

If anyone is interested, here's my script to do that (I place it in XFCE's Session and Startup)

#!/bin/bash
virtualbox --startvm Windows7 --fullscreen &
sleep 3
wmctrl -r "Windows7 [Running] - Oracle VM VirtualBox" -t1

exit 0

Replace Windows7 with whatever your VM name is

Offline

#4 2014-09-13 09:22:21

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Running a VM at Startup in Separate X Server

Hello, X now usually has to run on the same VT you logged in, maybe this was the problem...

Though I the solution you found is cleaner/easier now.
Maybe mark it as solved (?).

Regards


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

Board footer

Powered by FluxBB