aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvmx37
-rwxr-xr-xkvmx-create2
-rw-r--r--kvmxfile1
3 files changed, 24 insertions, 16 deletions
diff --git a/kvmx b/kvmx
index 079ea82..0c83fb9 100755
--- a/kvmx
+++ b/kvmx
@@ -1927,27 +1927,34 @@ function kvmx_xrandr {
exit 1
fi
- local mode="`xrandr | grep '*+' | awk '{ print $1 }' | tr 'x' ' '`"
+ if [ "$ssh_support" != "y" ]; then
+ echo "$BASENAME: xrandr needs ssh_support config"
+ exit 1
+ fi
- if [ ! -z "$resolution_y_offset" ]; then
- local x="`echo $mode | awk '{ print $1 }'`"
- local y="`echo $mode | awk '{ print $2 }'`"
+ if echo which xrandr | kvmx_ssh &> /dev/null; then
+ local mode="`xrandr | grep '*+' | awk '{ print $1 }' | tr 'x' ' '`"
- mode="$x $(($y $resolution_y_offset))"
- fi
+ if [ ! -z "$resolution_y_offset" ]; then
+ local x="`echo $mode | awk '{ print $1 }'`"
+ local y="`echo $mode | awk '{ print $2 }'`"
- if [ -z "$xrandr_device" ]; then
- xrandr_device="Virtual-0"
- fi
+ mode="$x $(($y $resolution_y_offset))"
+ fi
+
+ if [ -z "$xrandr_device" ]; then
+ xrandr_device="Virtual-0"
+ fi
- local line="`cvt $mode | tail -1 | sed -e 's/^Modeline//'`"
- local name="`echo $line | awk '{ print $1 }'`"
+ local line="`cvt $mode | tail -1 | sed -e 's/^Modeline//'`"
+ local name="`echo $line | awk '{ print $1 }'`"
- echo "Setting Modeline $line..."
+ echo "Setting Modeline $line..."
- echo DISPLAY=:0 xrandr --newmode $line | kvmx_ssh
- echo DISPLAY=:0 xrandr --addmode $xrandr_device $name | kvmx_ssh
- echo DISPLAY=:0 xrandr --output $xrandr_device --mode $name | kvmx_ssh
+ echo DISPLAY=:0 xrandr --newmode $line | kvmx_ssh
+ echo DISPLAY=:0 xrandr --addmode $xrandr_device $name | kvmx_ssh
+ echo DISPLAY=:0 xrandr --output $xrandr_device --mode $name | kvmx_ssh
+ fi
}
# Wrapper to kvmx-create
diff --git a/kvmx-create b/kvmx-create
index 64a66ec..43e5a82 100755
--- a/kvmx-create
+++ b/kvmx-create
@@ -115,12 +115,12 @@ function kvmx_config {
kvmx_user_config user user "Initial user name"
kvmx_user_config password $default_password "Initial user password"
kvmx_user_config net user "Networking config (user or tap)"
- kvmx_user_config net_dns 192.168.1.1 "DNS"
if [ "$net" == "tap" ]; then
kvmx_user_config net_ip 10.1.1.2 "IP address"
kvmx_user_config net_mask 255.255.0 "Netmask"
kvmx_user_config net_gateway 10.1.1.1 "Gateway"
+ kvmx_user_config net_dns 192.168.1.1 "DNS"
fi
if [ ! -z "$image_base" ]; then
diff --git a/kvmxfile b/kvmxfile
index 0a878b4..b7cf127 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -57,6 +57,7 @@ shared_folder_mountpoint="/home/$user/code/$VM"
# Absolute path for a provision script located inside the guest.
# Needs ssh_support set to "y" and a workable SSH connection to the guest.
+#provision_command="sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean"
#provision_command="/usr/local/share/kvmx/provision/development && /etc/puppet/bin/provision && /etc/puppet/bin/deploy"
#provision_command="/usr/local/share/kvmx/provision/development && /etc/puppet/bin/deploy"
#provision_command="/usr/local/share/kvmx/provision/development && /home/$user/code/$VM/bin/custom-provisioner"