Wednesday, June 10, 2020

Ubuntu 20.04 running on Lenovo Yoga 920 with HiDPI and touch screen support

I resized the windows partition to the minimum necessary (100G), disabled secure boot and I also remove bitlocker key encryption on windows drive, this allows Ubuntu to see that partition and allow windows to boot with secure boot disabled, without complaining.

This makes everything go easier if you want to keep windows around on the same disk and dual boot with Ubuntu, you should do this it helps a lot. Even after you disable this, you can re-enable it back, both secure boot and bitlocker key encryption.


Before installing you install windows updates, resize your windows partition. Installing all windows updates will not allow you to gain as much space as possible. After resizing the windows partition to the minimum size you want, install all windows updates, bios and driver updates.

I upgraded all windows updates to the latest version and all drivers to the latest version and upgraded the bios on windows to the latest version before installing Ubuntu, I don't think this makes much difference but at least I did it to make sure I have the latest firmware on all components and latest bios before installing Ubuntu.

To get to the bios press and hold Fn+F2 (bios) or Fn+F12 (USB boot devices), or insert a clip on the small orifice next to the power button while the laptop is powered off.

Everything else seems to be working fine.

Works:
  • all special keys
  • keyboard lights
  • bluetooth, WiFi
  • trackpad
  • touch screen
  • keyboard and mouse pad are disable in tablet mode
  • camera
  • hibernate
  • hidpi
  • pen works like a mouse, but there no apps on Ubuntu that I know that use the pen, using gnomes-boxes I tried windows 10 using sketchbook and it is slow, but it works fine.
  • screen rotation works while in tablet or tent mode.



Not Working:fingerprint reader
  • fingerprint reader

Dual Boot Setup
  • Before installing any windows updates, bios or driver updates, resize your windows partition in windows to the minimum size you want, otherwise windows updates might constrain the amount of free disk space you can reclaim. I reduced the windows partition size (to 100Gb) using Disk Management utility to the desired capacity to make space for Linux.
  • https://www.easeus.com/partition-master/shrink-windows-10-partition.html
  • Disable secure boot in bios, use your windows bitlocker key from windows website to be able to boot windows and after that remove secure block key encryption from you windows partition. This will make it much easier, see online instructions is easy. (optional step)
  • Download and install all windows updates. The pre-installed Lenovo service utility prompts to update the firmware.  I went ahead with it.
  • To get to the bios press Fn+F2 (bios) or Fn+F12 (USB boot devices), or insert a clip on the small orifice next to the power button while the laptop is powered off.
  • Boot with Ubuntu Live-USB from USB 3.1 port. I installed Ubuntu in the UEFI mode.
  • Using the installer, I created 2 partitions. (root installation, /home) and perform Ubuntu installation.
  • The dual boot setup is now ready! Upon rebooting, the UEFI boot menu shows options to boot into Linux or windows. With Kernel 5.04 in Ubuntu 20.04. (only fingerprint reader is not working out of the box)

Touchpad




I increased the speed, enabled "tap to click", "two finger scrooling". and on gnome-tweak enabled click method to "fingers".

References:

https://www.scrye.com/wordpress/nirik/2017/11/02/lenovo-yoga-920-the-overdetailed-fedora-linux-review/

Friday, November 16, 2018

Chromeos containers and vms - Ubuntu, Debian

VM commands - basic gentoo VM compiled by google to be small and fast

vsh dev - get a console for that vm
vmc start dev - also gets you a console and starts a vm
vmc stop dev - stop a vm (does not do much)
vmc destroy dev - (only works sometimes)
vmc list
vmc container

Inside the VM - in a vm you can create multiple containers

run_container.sh --container_name=devCon --user=lafaspot
lxc list - list all VMs
lxc image list - list all VM images on the box

Create a debian stable vm, using chromeos utility shell file, that provides better integration with chromeos.

run_container.sh --container_name=devCon --user=USERID

Ubuntu setup

lxc image copy ubuntu:18.10 local: --alias ubuntu1810
lxc launch ubuntu1810 cosmic
lxc exec cosmic -- bash

Goto to my github project to setup chromeos integration with your new ubuntu container

https://github.com/lafaspot/chromeOSUbuntu

Friday, July 13, 2018

Ubuntu how to setup a vpn connection, tsocks, corporate wifi with openconnect and openvpn or socks

These are just notes.

Cisco vpn setup with CSD support [corporate setup]


# install
sudo apt-get install openconnect network-manager-openconnect-gnome gconf2 lib32z1 lib32ncurses5 libpangox-1.0-0

#restart network-manager or reboot the laptop


Create ~/.cisco folder

mkdir ~/.cisco 

Download the csd-wrapper-sh from github

https://gist.github.com/l0ki000/56845c00fd2a0e76d688#file-csd-wrapper-sh

copy the csd-wrapper.sh to that folder

Edit the file and set the CSD_HOSTNAME

CSD_HOSTNAME=vpn-1-gci.yourcompany.com

Run the script to download the resources, one time, and make sure the resources are downloaded.

bash ~/.cisco/csd-wrapper.sh

On gnome shell, settings->network add a vpn connection


Command line with CSD support:

# open a connection with csd support, use --background to run as daemon
sudo openconnect --user=lafa --csd-user=lafa --csd-wrapper=/home/lafa/.cisco/csd-wrapper.sh --background --pid-file=${HOME}/vpn.pid vpn-1-gci.yourcompany.com:443/GeneralHybrid

Without CSD support

# select dynamic updates
sudo dpkg-reconfigure resolvconf

Gnome network manager GUI configuration

[This is not needed for Ubuntu 15.04 and 16.10]. The default routing rules are missing in ubuntu openconnect 15.10/16.04. After the network manager establishes the connection, the work around is to add a default route as specified below after the connection is established. Start a console and type the command below with the correct arguments.

sudo route add default netmask 255.255.255.0 gw 10.87.154.223 dev vpn0

run ifconfig to figure out the vpn device name, the gateway ip of the vpn device normally tun0 or vpn0.

Execute the command above and the default route should make the openconnect vpn work.

Command line without network manager

# open a connection, use --background to run as daemon
sudo openconnect --user=USERID server/group/

# open a connection with csd support, use --background to run as daemon
sudo openconnect --user=lafa --csd-user=lafa --csd-wrapper=/home/lafa/.cisco/csd-wrapper.sh --background --pid-file=${HOME}/vpn.pid vpn-1-gci.yourcompany.com:443/GeneralHybrid


# to stop the connection you can ctrl-c the terminal running openconnect or

sudo killall openconnect*

Setup openvpn using ibvpn.com provider and openvpn

sudo apt-get install openvpn easy-rsa network-manager-openvpn-gnome

goto http://www.ibvpn.com

setup a free account

extract openvpn.tgz where you want

On UbuntuGnome goto settings->network->add
select vpn->Import from file

Select ibVPN-US-Dallas.ovpn


Type your email
Get the password from the ibvpn website, this is not you ibvpn account password.




Select Add.
And try it out.

Using  a socks proxy instead of VPN


# run a local socks server
ssh -D 9999 proxy.server

# setweb browser proxy or gnome network proxy in gnome network settings.
proxy: localhost:9999

# To use other apps with socks install
sudo apt-get install tsocks

# Change config file to (remove everything else)
/etc/tsocks.conf
server = 127.0.0.1
server_port = 9999

# ssh to a machine
tsocks ssh -X bla.corp.com

# eclipse to a machine
tsocks eclipse

Using Cisco client


sudo apt-get update
sudo apt-get install lib32z1 lib32ncurses5 network-manager-openconnect libpangox-1.0-0
cd ~/Downloads
tar -xzvf anyconnect-predeploy-linux-64-4.3.05017-k9.tar\ 6.59.23\ AM.gz
sudo vpn_install.sh
sudo apt-get install network-manager-openconnect
sudo systemctl daemon-reload

# check if the process is running
ps auxw | grep vpnagentd | grep -v grep

# add alias to bash
cat >> ~/.bash_aliases
alias vpn='/opt/cisco/anyconnect/bin/vpn'
alias vpnui='/opt/cisco/anyconnect/bin/vpnui'
^D

# Fix certificates to use ubuntu certs
cd /opt/.cisco/certificates
sudo mv ca ca.orig
sudo ln -sf /etc/ssl/certs/ ca
sudo /etc/init.d/vpnagentd restart

Cisco download

https://software.cisco.com/download/home/286281283/type/282364313/release/4.6.01103

Reference: http://www.socsci.uci.edu/~jstern/uci_vpn_ubuntu/

Saturday, December 2, 2017

Ubuntu 17.10 running on Lenovo Yoga 920 with HiDPI and touch screen support


I resized the windows partiton to the minimun necessary (100G), disabled secure boot and I also remove bitlocker key encryption on windows drive, this allows Ubuntu to see that partition and allow windows to boot with secure boot disabled, without complaning.

This makes everything go easier if you want to keep windows arround on the same disk and dual boot with Ubuntu, you should do this it helps a lot. Even after you disable this, you can re-enable it back, both secure boot and bitlocker key encryption.

Before installing on windows updates resize your windows partition, installing all windows updates will not alow you to gain as much space as possible. After resizing the windows partition to the minimium size you want, install all windows updates, bios and driver updates.

I upgraded all windows updates to the latest version and all drivers to the latest version and upgraded the bios on windows to the latest version before installing Ubuntu, I don't think this makes much difference but at least I did it to make sure I have the latest firmware on all components and latest bios before installing Ubuntu.

To get to the bios press and hold Fn+F2 (bios) or Fn+F12 (USB boot devices), or insert a clip on the small orifice next to the power button while the laptop is powered off.

On reboot, it seems I had no wireless. A simple blacklisting of the ideapad_laptop module, for now, gets things working.

Everything else seems to be working fine.

Works:
  • all special keys
  • keyboard lights
  • bluetooth, WiFi
  • trackpad
  • touch screen
  • keyboard and mouse pad are disable in tablet mode
  • camera
  • hibernate
  • hidpi
  • pen works like a mouse, but there no apps on Ubuntu that I know that use the pen, using gnomes-boxes I tried windows 10 using sketchbook and it is slow, but it works fine.


Not Working:fingerprint reader
  • fingerprint reader
  • screen rotation not working, while in tablet mode.


Dual Boot Setup
  • Before installing any windows updates, bios or driver updates, resize your windows partition in windows to the minimun size you want, otherwise windows updates might constrain the amount of free disk space you can reclaim. I reduced the windows partition size (to 100Gb) using Disk Management utility to the desired capacity to make space for Linux.
  • http://www.everydaylinuxuser.com/2015/11/how-to-shrink-windows-10-to-make-space.html
  • Disable secure boot in bios, use your windows bitlocker key from windows website to be able to boot windows and after that remove secure block key encryption from you windows partition. This will make it much easier, see online instructions is easy. (optional step)
  • Download and install all windows updates. The pre-installed Lenovo service utility prompts to update the firmware.  I went ahead with it.
  • To get to the bios press Fn+F2 (bios) or Fn+F12 (USB boot devices), or insert a clip on the small orifice next to the power button while the laptop is powered off.
  • Boot with Ubuntu Live-USB from USB 3.1 port. I installed Ubuntu in the UEFI mode.
  • Using the installer, I created 2 partitions. (root installation, /home) and perform Ubuntu installation.
  • On reboot, it seems I had no wireless. A simple blacklisting of the ideapad_laptop module, for now, gets things working. "/etc/modprobe.d/blacklist.conf"
  • The dual boot setup is now ready! Upon rebooting, the UEFI boot menu shows options to boot into Linux or windows. With Kernel 4.13 in Ubuntu 17.10, most of the things work out of the box as a laptop. (only fingerprint reader and tilt sensor for tablet mode are not setup out of the box)
  • I haven't yet fiddled around to see if it correctly works in the tablet mode.

Touchpad


I increased the speed, enabled "tap to click", "two finger scrooling". and on gnome-tweak enabled click method to "fingers".

References:

https://www.scrye.com/wordpress/nirik/2017/11/02/lenovo-yoga-920-the-overdetailed-fedora-linux-review/

Friday, December 1, 2017

How to resize a Windows VM image with virt-resize qcow2

Notes

apt install libguestfs-tools virt-manager gnome-boxes

Check for snapshots and delete them:

qemu-img info win10.qcow2
qemu-img snapshot -l win10.qcow2
qemu-img snapshot -d 4  win10.qcow2

 Resize:

qemu-img info win10.qcow2
qemu-img resize win10.qcow2 +23G

List partitions, select partition to get the new size, resize that partition

sudo virt-filesystems -hl -a win10.qcow2
Name       Type        VFS   Label            Size  Parent
/dev/sda1  filesystem  ntfs  System Reserved  500M  -
/dev/sda2  filesystem  ntfs  -                39G   -
/dev/sda3  filesystem  ntfs  -                843M  -

qemu-img create -f qcow2 win10_63G.qcow2 63G
sudo virt-resize --expand /dev/sda2 win10.qcow2  win10_63G.qcow2


References:

https://mike42.me/blog/how-to-resize-a-windows-vm-image-with-virt-resize

Sunday, October 8, 2017

Ubuntu 17.10 review. Running with hidpi, touch screen and wayland support

Ubuntu GNOME 17.10



I think Ubuntu GNOME is the best flavor of Ubuntu if you are running in HiDPI mode 3200x1800 with a touchscreen. All screen captured images are at HiDPI resolution.

Since I prefer the standard gnome-session experience, I installed the "gnome-session" package and rebooted the system. And on the cog icon next to the sign in button, select the "GNOME" instead of ''Ubuntu" option before clicking the sign in button.

sudo apt install gnome-session

Touchpad


I increased the speed, enabled "tap to click", "two finger scrooling". and on gnome-tweak enabled click method to "fingers".

Touch support

Ubuntu gnome support for touchscreen is pretty good on the desktop.
Chromium browser supports touch screen very well and much better than Firefox without any plug-ins.
In my Yoga pro 2, the windows key on the screen panel works as the windows key on the keyboard.
Screen rotation is supported on the new gnome and disables the keyboard when the yoga is used as a tablet, but not the touchpad, side lock rotation button works to lock the screen in a certain rotation.

Screen HiDPI support

Ubuntu will boot with full resolution HiDPI and touch screen support enabled, brightness keys, resolution keys and, option keys to turn off the screen, all work.

You can change the resolution in the settings to another resolution in case you don't want to use HiDPI, selecting 1920x1080 that should give you a good scale ratio on the Yoga Pro 2.




Software

Ubuntu uses Firefox as the default browser, I installed chromium since I like it better, I also changed the default to be the native gnome experience which I think is better than the Ubuntu changes made to gnome-shell.

I also installed most of Gnome apps, Gnome games, gnome-boxes and Virtual Machine manager, described in the last section to have some relaxing and productivity apps. I have done a blog post earlier on how to install windows on gnome-boxes and make run as fast as possible with virtio drivers.


I also installed Skype, Spotify and Google Chrome browser and all applications work well in the new Ubuntu 17.10.

I setup Cisco VPN using open connect with support for "Cisco Secure Desktop trojan" to access my company VPN, all is working great.

Ubuntu is using Wayland graphical server by default and I don't notice much difference between Wayland and Xorg, seems a bit slow with 2 monitors, but It might be because of hi-dpi on both screens since before I was using 1080p resolutions.

I also installed gnome-tweak and added the minimise button to all windows, as you can see from the screenshot.

Camera, Sound, Keyboard, Sleep, WifiBluetooth, USB3

Camera, sleep, wifi, Bluetooth, USB3, side sound button up/down, keyboard background light works, Special Fn key mute, volume up, volume down, turn off screen, refresh, brightness up and down, menu key, keyboard light, airplane mode, all work as expected.

Fn key to show all screens works but it is a shortcut to Activities menu so you don't have to use the touchpad.

Tweaks to make some Apps work better with HiDPI 

Firefox, Chromium, Google Chrome, Skype, Thunderbird, Cheese, totem work great in HiDPI.

Blender, Gimp, Spotify, VLC, Pinta do not support hi-dpi properly.

Download links for Chrome, Spotify, Skype:

https://www.google.com/chrome/browser/desktop/index.html
https://www.spotify.com/us/download/linux/
https://www.skype.com/en/get-skype/

Work arround for Spotify:

Add --force-device-scale-factor=1.5 (or whatever fits your UI scale) as a command line option.

You could edit /usr/share/applications/spotify.desktop or wherever the .desktop file is located and change the line with Exec= to:

Exec=spotify --force-device-scale-factor=1.5 %U

Signal Messenger:
curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list
sudo apt update && sudo apt install signal-desktop





Get Chrome, Skype, Spotify from their websites, the download is well supported on Ubuntu.


Chromium supports the touchscreen better than Firefox if you wish to use it with the touchscreen, Chromium is the better choice,

If you use a HiDPI monitor such as Retina display together with another monitor, you can use AutoHiDPI add-on in order to automatically adjust  layout.css.devPixelsPerPx setting for the active screen.

If you use the touchscreen you should install Grab and Drag add-on to make Firefox more tablet friendly.

Reference for other applications on HiDPI

archlinux HiDPI documentation

Console

Configure larger font on tty console, leave all settings as they are, but for font select Terminus, and on the last one, where you can choose the size 16x32, and then reboot.

sudo dpkg-reconfigure console-setup

Reference: https://wiki.archlinux.org/index.php/HiDPI

Does not work out of the box

The Fn key to disable track-pad function on my Yoga Pro 2 does not work on Ubuntu.

Ubuntu extras and tools

sudo apt install ubuntu-restricted-extras

### DVD support
sudo /usr/share/doc/libdvdread4/install-css.sh

### Gnome utilities
sudo apt install pithos adwaita-icon-theme-full vlc bijiben polari gnome-weather epiphany-browser p7zip-rar p7zip-full unace unrar zip unzip sharutils rar uudeview mpack arj cabextract file-roller htop dconf-editor gnome-backgrounds gnome-bluetooth gnome-boxes gnome-calculator gnome-calendar gnome-clocks gnome-color-manager gnome-contacts gnome-control-center gnome-dictionary gnome-disk-utility gnome-documents gnome-logs gnome-maps gnome-music gnome-online-accounts gnome-photos gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-sound-recorder gnome-sushi gnome-system-monitor gnome-terminal gnome-themes-standard gnome-tweak-tool gnome-weather frogr vinagre ghex chromium-browser gnome-todo solaar




### Simple Games
sudo apt install gnome-chess five-or-more four-in-a-row gnome-klotski gnome-nibbles gnome-robots gnome-sudoku gnome-mahjongg gnome-tetravex iagno lightsoff quadrapassel swell-foop






### Video Editing, Flowblade video editor,Blender
sudo apt install openshot openshot-doc flowblade blender
sudo apt install kdenlive

### Video Editing Openshot
sudo add-apt-repository ppa:openshot.developers/ppa
sudo apt update
sudo apt install openshot-qt

### pitivi
### As user run 
flatpak install --user http://flatpak.pitivi.org/pitivi-master.flatpakref

### Install cinelerra
sudo add-apt-repository ppa:cinelerra-ppa/ppa
sudo apt update
sudo apt install cinelerra-cv

### Lightworks
### https://www.lwks.com/
### download and get the deb from the website
sudo dpkg -i lwks-14.0.0-amd64.deb
sudo apt --fix-broken install

### Other tools
sudo apt install clementine  picard

### Image editing
sudo apt install darktable gimp krita pinta blender

### Run windows or other linux versions inside Ubuntu
### See my other blog post on how to run Windows 10 inside gnomes-boxes
sudo apt install gnome-boxes
sudo apt install virtualbox

### Gnome development tools
sudo apt-get install gnome-builder glade gitg ghex

# flash
sudo apt install flashplugin-installer


Tuesday, August 22, 2017

Asus Chromebook C302 with Android Apps


I got an Asus Chromebook 302 that comes with an Intel core m3, 64Gb, 4Gb of memory.

Some problems I got on my device:

After I enabled the android app store the laptop started to reboot randomly. I tried removing the apps and switching chrome os channels, but it did not fix the problem.

So I decided to create a recovery SDCard using chrome recovery utility. I re-imaged the laptop with the SD card, using the instructions from the chrome recovery utility.

After that the laptop booted in stable channel, I update the laptop to the latest stable image.


List of Applications I am running:

Pandora, Yahoo Mail, Yahoo Messenger, Hangouts, Play Newsstand, Hangouts Dialer, Calendar, Photos, Npr One, Voxer, Twilight, Firefox, Youtube, Google wifi, Hipchat, 3Dmark.

Here is a screenshot running 23 Android applications at same time.


This is screen shot running twilight, for those of us missing a blue light filter.


3DMark and Octane

The score below is running in the ChromeOS dev channel. I only able to get octane scores between 15000-17000, but the machine still feels really fast.



UnKilled




Alto


The Asus Chromebook C302


This post was written on the Asus C302. I am very impressed with it and would highly recommend it.

Pros:
  • Amazing performance,
  • Very good build quality, a great keyboard, very nice screen, and just a premium solid feel to it
  • Android apps on
  • Great backlit keyboard (Mac-book Pro feel)
  • Convertible
  • Some Android apps like calendar, Pandora, photos, YouTube, Firefox support bigger screen, but most apps still don't, and these apps render in landscape or portrait more like they look on a phone, but without using the extra space of the big screen.
  • I like the USB C cable and being able to charge the laptop from both sides, avoids awkward cables when the charger is on the wrong side, like my other laptops.
  • Fanless, silent, love that.
  • Charging is fast.

Cons:
  • Android apps only support 2 sizes, full screen or phone size. In full-screen mode the majority of the apps are just a large super sized version of the phone version, offering very little extra functionality.

Implementing a killswitch when your VPN connection drops on Ubuntu

VPN setup on ubuntu I setup the VPN in these 2 modes in Ubuntu 24.04, 25.04, 25.10, screen shoots are from 25.10.  Using only ubuntu pre pac...