LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-29-2015, 12:23 PM   #1
kingkong89
LQ Newbie
 
Registered: Sep 2015
Posts: 2

Rep: Reputation: Disabled
Ubuntu 14.04 x64 - xfce with vnc - auto login, auto start wine app


UBUNTU 14.04 X64 - XFCE WITH VNC - AUTO LOGIN, AUTO START WINE APP

adduser rapid_vn
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-get install xfce4
sudo apt-get install firefox
sudo apt-get install gnome-schedule
sudo apt-get install wine
sudo apt-get upgrade
sudo apt-get clean

INSTALL TIGHT VNC SERVER

apt-get install tightvncserver

CHANGE USER

su - rapid_vn

SET PASSWORD FOR VNC SERVER WITH USER rapid_vn

vncpasswd

LOGOUT USER rapid_vn

exit

CONFIG VNC SERVER

nano /etc/init.d/vncserver

#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="rapid_vn"
DISPLAY="1"
DEPTH="16"
DPI="96"
GEOMETRY="800x600"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} -alwaysshared -dpi ${DPI} :${DISPLAY}"
. /lib/lsb/init-functions

case "$1" in
start)
log_action_begin_msg "STARTING VNCSERVER FOR USER '${USER}' ON LOCALHOST:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;

stop)
log_action_begin_msg "STOPING VNCSERVER FOR USER '${USER}' ON LOCALHOST:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;

restart)
$0 stop
$0 start
;;
esac
exit 0

nano /home/rapid_vn/.vnc/xstartup

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
startxfce4 &

chown -R rapid_vn. /home/rapid_vn/.vnc && chmod +x /home/rapid_vn/.vnc/xstartup
sed -i 's/allowed_users.*/allowed_users=anybody/g' /etc/X11/Xwrapper.config

chmod +x /etc/init.d/vncserver
service vncserver start

update-rc.d vncserver defaults

reboot

MAKE AUTO START FIREFOX ON REBOOT

mkdir /home/rapid_vn/.config
mkdir /home/rapid_vn/.config/autostart

chmod u=rwx,g=rwx,o=rwx /home/rapid_vn/.config
chmod u=rwx,g=rwx,o=rwx /home/rapid_vn/.config/autostart

nano /home/rapid_vn/.config/autostart/firefox.desktop

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Firefox Browser
Comment=Firefox Browser
Exec=/usr/bin/firefox
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

MAKE AUTO START MT4 ON REBOOT

nano /home/rapid_vn/.config/autostart/metatrader4.desktop

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=MetaTrader 4
Comment=MetaTrader 4
Exec=wine "C:\\Program Files (x86)\\MetaTrader 4\\Terminal.exe"
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
Hidden=false

MAKE SCRIPT RESTART METATRADER 4

nano /home/rapid_vn/restart_mt4.sh

#!/bin/sh
pkill Terminal.exe &
pkill terminal.exe &
env DISPLAY=:1 wine "C:\\Program Files (x86)\\MetaTrader 4\\Terminal.exe" &

MAKE TASK SCHEDULE RUN SCRIPT

mkdir /home/rapid_vn/.gnome
mkdir /home/rapid_vn/.gnome/gnome-schedule
mkdir /home/rapid_vn/.gnome/gnome-schedule/crontab

chmod u=rwx,g=rwx,o=rwx /home/rapid_vn/.gnome
chmod u=rwx,g=rwx,o=rwx /home/rapid_vn/.gnome/gnome-schedule
chmod u=rwx,g=rwx,o=rwx /home/rapid_vn/.gnome/gnome-schedule/crontab

nano /home/rapid_vn/.gnome/gnome-schedule/crontab/1

ver=5
title=Restart MetaTrader 4
desc=
output=0
display=0
command_d=sh /home/rapid_vn/restart_mt4.sh

echo 1 > /home/rapid_vn/.gnome/gnome-schedule/crontab/last_id

EDIT TIME RUN TASK SCHEDULE

su - rapid_vn
crontab -e

58 23 * * * sh /home/rapid_vn/restart_mt4.sh # JOB_ID_1

exit

reboot
 
  


Reply



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
[CentOS6 x64] Shell Script - Auto-set VNC password? linuxtest21 CentOS 1 05-24-2015 08:09 AM
How to auto start vnc4server on Debian 5 x64? sandygws Linux - Software 3 11-27-2009 02:49 PM
auto login xfce smOk3 Slackware 1 02-27-2008 05:55 AM
How to configure auto login & after login auto startup some program. hocheetiong Linux - Newbie 1 02-18-2008 12:49 AM
Red Hat 9.1 + VNC Auto Start JustMe5551212 Linux - Newbie 8 09-26-2003 09:51 PM

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

All times are GMT -5. The time now is 10:02 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