2183
Comment:
|
7121
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Developing on a native Linux platform = | ## page was renamed from OPWfirstpatchAlt = Running Linux in a VM = |
Line 3: | Line 4: |
These instructions assume you're running a varient of Ubuntu (like 12.04 LTS). | = Hardware Requirements = |
Line 5: | Line 6: |
== Install some packages == | You need a system with virtualization (VT-d), at least 4GB of RAM, and 40GB of free hard drive space in order to run Linux in a VM. If you want to download and compile the kernel, you may need additional space of up to 20GB. Also, ensure that Virtualization is enabled in your Host machine's system BIOS. |
Line 7: | Line 9: |
First, open a terminal. Click the ubuntu logo at the top left corner and type "terminal". Click the terminal screen icon. | == Alternatives == |
Line 9: | Line 11: |
Tip: You may want to pin the terminal app for easy access by hitting the Windows logo key, moving your mouse over the terminal icon on the left vertical menu, right clicking, and chosing "Lock to Launcher". You can make the menu go away by hitting the escape key. | If your system doesn't meet those requirements, you will need to be running Linux, or dual boot your machine so you can run both Linux and Windows. We strongly suggest you use the [[https://ubuntu.com/download/desktop/thank-you?version=20.04.4&architecture=amd64|Ubuntu 20.04 64-bit version]]. If your machine doesn't have 64-bit support, you can use ubuntu 16.04 [[http://www.ubuntu.com/download/desktop/thank-you?release=lts&bits=32&distro=desktop&status=zeroc|32-bit version]]. Once you have Ubuntu installed, please follow the directions [[OPWfirstpatch|here]]. |
Line 11: | Line 14: |
Next, run this command: | = Download Ubuntu 20.04 or 22.04 = [[https://ubuntu.com/download/desktop/thank-you?version=20.04.4&architecture=amd64|Download link to]] Ubuntu 20.04 64-bit version. [[https://ubuntu.com/download/desktop/thank-you?version=22.04.1&architecture=amd64|Download link to]] Ubuntu 22.04 64-bit version. = Installing Virtual Machine or Hypervisor = You may choose to install VMPlayer or Qemu KVM as your hypervisor or Virtual Machine software. = 1. Install VMPlayer = Go to the [[http://www.vmware.com/products/player/|VMPlayer website]] and click the 'download' link. Download the VMPlayer that's appropriate for your operating system (e.g. Windows or Linux 64-bit), and install it. == Linux VMPlayer installation instructions == The [[http://www.vmware.com/products/player/|VMPlayer download]] comes as a .bundle file. That's a binary executable, that will launch a setup wizard. First, change to the directory where you downloaded the VMPlayer binary by using the command {{{cd}}}. Tip: {{{cd}}} changes the current working directory to a different directory. You can learn more about any command by reading the manual pages. Simply prefix the command with the word "man", e.g. {{{man cd}}}. Next, check to see if the file is executable. Run this command: |
Line 14: | Line 37: |
sudo apt-get install vim libncurses5-dev gcc make git exuberant-ctags}}} | ls -l}}} |
Line 16: | Line 39: |
== Setup your Linux kernel code repository == Once that finishes, run these three commands: {{{ mkdir git mkdir git/kernels cd git/kernels}}} Tip: mkdir creates directories, and cd changes the current working directory to a different directory. You can learn more about any command by reading the manual pages. Simply prefixing the command with the word "man", e.g. {{{man mkdir}}}. Then use the revision control system called [http://git-scm.com/ git] to clone Linus Torvalds' repository: |
Then look at at the file's listing, and see if it has the executable ("x") bit set: |
Line 29: | Line 42: |
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git}}} | $ ls -l total 181056 -rw-rw-r-- 1 sarah sarah 185386101 Apr 26 22:19 VMware-Player-5.0.2-1031769.x86_64.bundle}}} |
Line 31: | Line 46: |
== Optional suggestions for Ubuntu == | If it doesn't show the executable bit, make the file executable by running: |
Line 33: | Line 48: |
You might want to change some Ubuntu default settings. By default, after the system is idle, the screen blanks and you'll have to re-enter your password when you start using it. You can turn off the screen lock on resume by hitting the Windows key, clicking the wrench icon ("System Settings") in the left vertical menu. Then click the "Brightness and Lock" icon, and hit the Lock toggle button to make it read OFF. You probably still want to require your password when waking from suspend, but it's up to you. | {{{ chmod a+x VMware-Player-5.0.2-1031769.x86_64.bundle}}} |
Line 35: | Line 51: |
You can close an app at any time by hitting the X button on the top left of the window, or if the window is maximized, moving your mouse cursor to the top left, and clicking the X button that's revealed. Do not close the terminal in this way. It's safer to close it by hitting CTRL+d, because it will prompt you if you still have programs running in the background. | Then execute the binary by prefixing it with a ./ and running it as the root user with sudo: {{{ sudo ./VMware-Player-5.0.2-1031769.x86_64.bundle}}} Tip: Be careful about what you run as root! The root user has access to all the files on your system, so you usually don't want to run arbitrary commands as root. Always run commands without sudo, and without changing to a root terminal, where ever possible. = Running Ubuntu 20.04 in a VM = == VMPlayer Setup == Click "Create a New Virtual Machine". "Use an ISO image" and select the Ubuntu 20.04 ISO you downloaded. Hit "Next". Fill in your name, username, and a password, and hit "Next". The next screen is your computer's information. The "Name" will be used for the machine name, and shown in all terminal prompts, so pick something short and sweet. You can change the Location of your VM independent of what you name the machine. The next screen is hardware info. Increase the disk size to 40 GB, and chose "Store virtual disk as a single file". This makes it easier to copy the VM image from computer to computer. Uncheck "Automatically Start the VM". Before you start the VM, you need to make some adjustments to the emulated hardware. Click "Edit virtual machine settings". Now, adjust the amount of memory available to the VM to be the recommended amount of memory. You also want to adjust the number of CPUs available to the guest. It should not be more CPUs than you have available (e.g. if you have a dual core, it should not be more than 2). Click the 'Save' button. Once you've adjusted the emulated hardware, start the VM by clicking "Play virtual machine". If a "Removable devices" window pops up, click "ok". On the Software Updates window, click "Download and install". Please wait for the software updates to download and install before you start using the VM. Otherwise the VM will be very VERY slow. After Ubuntu 20.04 has finished installing, you can proceed to these [[OPWfirstpatch#kernel-setup-done|instructions]] = 2. Qemu as your Virtual Machine = Qemu is a KVM based open source Hypervisor solution. It has significant performance advantages if installed on a Linux based host platform. == Installing KVM on Ubuntu == Follow these steps to install KVM on your Ubuntu host platform: === 1. Confirm Virtualization Support === First, confirm that your host platform supports virtualization by running following command: {{{ $ lscpu | grep Virtualization Virtualization: VT-x}}} Thats what you should see on a Intel based board. If you are running another processor such as AMD, the outcome will be different. In case if you do not see any results of the above command, your processor may not support Virtualization. === 2. Install Qemu KVM package === Now, you can execute following commands to get Qemu installed: {{{ $ sudo apt install qemu-kvm}}} That would install the Qemu based KVM paclage on your Ubuntu host. === 3. Install Virtualization APIs === You now need to install the virtualization API requried to communicate with the KVM. You will need to install following two packages: {{{ $ sudo apt install libvirt-daemon-system}}} {{{ $ sudo apt install libvirt-clients}}} === 4. Setting up the user for KVM access === If you now run command ''cat /etc/group'' on your terminal shell prompt, you should see a new user groups named kvm and libvirt added the group list. You now need to have your own user to be part of these new groups to be able to work with the KVM system. To add your userID to the KVM and libvirt groups on the system run following command: {{{ $ sudo adduser $USER kvm}}} You will need to reboot your system for the group changes to take effect. Once you are back on run ''groups'' command in terminal to confirm that you are now part of the KVM and libvirt groups. === 5. Install the VM UI === It is very convinient to use the Qemu KVM User Interface. We can install it using the following command: {{{ $ sudo apt install virt-manager}}} That would finish the installation of the Qemu KVM on your Ubuntu Host. You are now ready to lauch the Virtual Machine Manager UI from the Ubuntu Apps menu. Once you have the Virtual Machien Manager screen open, use the "Add New Virtual Machine" menu and work-flow to add a Virtual Linux guest OS such as Ubuntu, Debian, openSuse etc of your choice. |
Running Linux in a VM
Hardware Requirements
You need a system with virtualization (VT-d), at least 4GB of RAM, and 40GB of free hard drive space in order to run Linux in a VM. If you want to download and compile the kernel, you may need additional space of up to 20GB. Also, ensure that Virtualization is enabled in your Host machine's system BIOS.
Alternatives
If your system doesn't meet those requirements, you will need to be running Linux, or dual boot your machine so you can run both Linux and Windows. We strongly suggest you use the Ubuntu 20.04 64-bit version. If your machine doesn't have 64-bit support, you can use ubuntu 16.04 32-bit version. Once you have Ubuntu installed, please follow the directions here.
Download Ubuntu 20.04 or 22.04
Download link to Ubuntu 20.04 64-bit version. Download link to Ubuntu 22.04 64-bit version.
Installing Virtual Machine or Hypervisor
You may choose to install VMPlayer or Qemu KVM as your hypervisor or Virtual Machine software.
1. Install VMPlayer
Go to the VMPlayer website and click the 'download' link. Download the VMPlayer that's appropriate for your operating system (e.g. Windows or Linux 64-bit), and install it.
Linux VMPlayer installation instructions
The VMPlayer download comes as a .bundle file. That's a binary executable, that will launch a setup wizard.
First, change to the directory where you downloaded the VMPlayer binary by using the command cd.
Tip: cd changes the current working directory to a different directory. You can learn more about any command by reading the manual pages. Simply prefix the command with the word "man", e.g. man cd.
Next, check to see if the file is executable. Run this command:
ls -l
Then look at at the file's listing, and see if it has the executable ("x") bit set:
$ ls -l total 181056 -rw-rw-r-- 1 sarah sarah 185386101 Apr 26 22:19 VMware-Player-5.0.2-1031769.x86_64.bundle
If it doesn't show the executable bit, make the file executable by running:
chmod a+x VMware-Player-5.0.2-1031769.x86_64.bundle
Then execute the binary by prefixing it with a ./ and running it as the root user with sudo:
sudo ./VMware-Player-5.0.2-1031769.x86_64.bundle
- Tip: Be careful about what you run as root! The root user has access to all the files on your system, so you usually don't want to run arbitrary commands as root. Always run commands without sudo, and without changing to a root terminal, where ever possible.
Running Ubuntu 20.04 in a VM
VMPlayer Setup
Click "Create a New Virtual Machine". "Use an ISO image" and select the Ubuntu 20.04 ISO you downloaded. Hit "Next". Fill in your name, username, and a password, and hit "Next".
The next screen is your computer's information. The "Name" will be used for the machine name, and shown in all terminal prompts, so pick something short and sweet. You can change the Location of your VM independent of what you name the machine.
The next screen is hardware info. Increase the disk size to 40 GB, and chose "Store virtual disk as a single file". This makes it easier to copy the VM image from computer to computer. Uncheck "Automatically Start the VM".
Before you start the VM, you need to make some adjustments to the emulated hardware. Click "Edit virtual machine settings". Now, adjust the amount of memory available to the VM to be the recommended amount of memory. You also want to adjust the number of CPUs available to the guest. It should not be more CPUs than you have available (e.g. if you have a dual core, it should not be more than 2). Click the 'Save' button.
Once you've adjusted the emulated hardware, start the VM by clicking "Play virtual machine". If a "Removable devices" window pops up, click "ok". On the Software Updates window, click "Download and install".
Please wait for the software updates to download and install before you start using the VM. Otherwise the VM will be very VERY slow.
After Ubuntu 20.04 has finished installing, you can proceed to these instructions
2. Qemu as your Virtual Machine
Qemu is a KVM based open source Hypervisor solution. It has significant performance advantages if installed on a Linux based host platform.
Installing KVM on Ubuntu
Follow these steps to install KVM on your Ubuntu host platform:
1. Confirm Virtualization Support
First, confirm that your host platform supports virtualization by running following command:
$ lscpu | grep Virtualization Virtualization: VT-x
Thats what you should see on a Intel based board. If you are running another processor such as AMD, the outcome will be different. In case if you do not see any results of the above command, your processor may not support Virtualization.
2. Install Qemu KVM package
Now, you can execute following commands to get Qemu installed:
$ sudo apt install qemu-kvm
That would install the Qemu based KVM paclage on your Ubuntu host.
3. Install Virtualization APIs
You now need to install the virtualization API requried to communicate with the KVM. You will need to install following two packages:
$ sudo apt install libvirt-daemon-system
$ sudo apt install libvirt-clients
4. Setting up the user for KVM access
If you now run command cat /etc/group on your terminal shell prompt, you should see a new user groups named kvm and libvirt added the group list. You now need to have your own user to be part of these new groups to be able to work with the KVM system.
To add your userID to the KVM and libvirt groups on the system run following command:
$ sudo adduser $USER kvm
You will need to reboot your system for the group changes to take effect. Once you are back on run groups command in terminal to confirm that you are now part of the KVM and libvirt groups.
5. Install the VM UI
It is very convinient to use the Qemu KVM User Interface. We can install it using the following command:
$ sudo apt install virt-manager
That would finish the installation of the Qemu KVM on your Ubuntu Host. You are now ready to lauch the Virtual Machine Manager UI from the Ubuntu Apps menu. Once you have the Virtual Machien Manager screen open, use the "Add New Virtual Machine" menu and work-flow to add a Virtual Linux guest OS such as Ubuntu, Debian, openSuse etc of your choice.