2021年12月30日 星期四

How to set up USB for Virtualbox?

How to set up USB for Virtualbox?


1. Install Extension Pack

  For USB 2.0 and USB 3.0 we need to install the free (but closed source) VirtualBox Extension Pack from the VirtualBox download page

  

2. Become a "vboxuser" in Host machine (local machine)

To be able to get access to an attached USB device, the Ubuntu host user needs to be in the vboxusers group. Add your user to this group by running the following command


sudo usermod -aG vboxusers <username> 


and reboot or logout/login.


3. Activate USB support in VirtualBox Manager


Shut down your virtual machine and open USB settings in the VirtualBox Manager. Tick Enable USB Controllerand USB 2.0 (EHCI) Controller or USB 3.0 (xHCI) Controller.


Suggestion: using USB 2.0 (EHCI) Controller


4. Select host USB device for access from the guest

To grant access to USB devices we need to select a device to disable in the host and to enable in the guest (this is a precaution to avoid simultaneous access from host and guest). This can be done from the panel Devices menu or by right mouse click in the bottom panel of the VirtualBox Manager on the USB icon:


Tick the device you need in the guest, untick it if you need it in the host. If you can't see your USB device in that list, it means that VirtualBox cannot access your host USB devices. Make sure your user is added to the vboxusers group and that you restarted your host.


The selected device will immediately be accessible from the guest.


Refer to : https://askubuntu.com/questions/25596/how-to-set-up-usb-for-virtualbox


2021年11月11日 星期四

How to make 'python' program command execute Python 3?

/usr/bin/env: ‘python’: No such file or directory

 

Method 1: (This method is failed to "#! /usr/bin/env")

   putting alias in the user's ~/.bashrc

   example:

   alias python=python3


Method 2: (This method is OK to "#! /usr/bin/env")

  $ whereis python3

  $ ls -lisa /usr/bin/python*

  $ sudo ln -s /usr/bin/python3 /usr/bin/python


Method 3:

  $ sudo apt install python-is-python3

2021年10月22日 星期五

Install Chinese Input on Ubuntu 20.04

1. Settings / Region & Language / Input Sources / Manage Installed Language

    Add Chinese

2. Settings / Region & Language / Input Sources / + 

    Select ... , 

    then Other, 

    then select Chinese, Press Add

3. Settings / Region & Language / Input Sources / Chinese

    Press Chinese, Select Chinese (Chewing)


2021年10月8日 星期五

VirtualBox Copy & Paste don't work between host and guest OS (for Ubuntu)

Refer to https://askubuntu.com/questions/63420/how-to-fix-virtualboxs-copy-and-paste-to-host-machine



1) VirtualBox / Machine / General / Advanced
    Shared Clipboard: Bidirectional
            Drag'n' Drop: Bidirectional
2) The guest's Ubuntun terminal commands:
sudo apt install virtualbox-guest-x11 --reinstall
VBoxClient-all --clipboard
I used --reinstall option because of I had virtualbox-guest-x11 package installed and before reinstalling it I had:
$ VBoxClient-all --clipboard
VBoxClient: error: No service specified. Quitting because nothing to do!
3) After reboot screen resolution jumps to its minimal value, so
Run Guest OS (Ubuntu) / Settings / Displays / Resolution