Virtualization quickstart » History » Revision 8
Revision 7 (Ichimonji10, 07/27/2017 04:41 PM) → Revision 8/21 (Ichimonji10, 07/27/2017 05:00 PM)
# Virtualization quickstart This quickstart guide has been tested on Fedora 25. Within code blocks, a prefix of `$` indicates that a command should be executed as a regular user, and `#` indicates that a command should be performed as root. ## Option 1: Using libvirt and Virtual Machine Manager on a Fedora 25 machine: Install required the following packages: ~~~ # $ sudo dnf install libvirt qemu-kvm kvm libguestfs-tools virt-install ~~~ Then, download an image for the OS you want to run in your VM. Here is a link to download an .iso for Fedora ISOs may be downloaded [from here](https://getfedora.org/en/workstation/download/). 26: https://getfedora.org/en/workstation/download/ Launch the To launch "Virtual Machine Manager" application press Super key and click: search "Virtual Machine Manager" 1\. 1\) File -\> New Virtual Machine 2\. 2\) Local install media -\> Browse \* use file browser to find your downloaded ISO image 3\) Accept accept default settings ### SETTING UP THE VM: 1\. - Start the VM with the "play button" 2\. - Choose to install fedora: 3\. - set hostname: give it a name other than localhost. 4\. - make it meaningful 5\. - set root password (weak one is OK) 6\. - if you make a user, make sure to give them sudo access **NOTE**: > NOTE: > If you forgot to make a user "admin" have sudo access: > Once VM is running, go to terminal and forgot switch to give them sudo access, start the VM, open a terminal, and: root ~~~ $ su # sudo gpasswd --add admin wheel ~~~ Then restart. **WARNING**: `localhost` > WARNING: \`localhost\` is a **bad** BAD hostname. Each of your VMs should have a unique hostname. If \> you clone a VM, both hosts have cloned this VM from another, it will have the same hostname. This needs to change It is imperative that you change your a host's hostname before installing any pulp components, as Pulp uses its host's hostname, they use the hostname and Pulp can produce undefined behavior if its host's the hostname is changed after the fact. To see See your host's hostname, execute current hostname with: `hostname`. To change your host's hostname, run: ~~~ # $ sudo hostnamectl set-hostname <new-hostname> DESIRED_NAME ~~~ ### SETTING UP ANSIBLE (on the VM): Install Ansible: the ansible package: ~~~ # $ sudo dnf install ansible git ~~~ Ansible info: For documentation see http://docs.ansible.com/ Download the pulp_packaging repo: ~~~ $ git clone https://github.com/pulp/pulp_packaging.git ~~~ Now we need to make a `hosts` file for Ansible. ansible. Use the results of the `hostname` command in the place of 'localhost': ~~~ $ cd pulp_packaging/ci/ansible $ echo "$(hostname)" > hosts ~~~ ### Choosing what version of pulp to install To choose the version of pulp that you will install: - install, edit `pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml`, or - the file: `pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml` OR pass `-e pulp_version=2.14 -e pulp_build=nightly` in the ansible-playbook invocation, or - invocation. OR in hosts file, specify pulp_version and pulp_build on the same line as hostname, i.e. `name_of_host pulp_version=2.14 pulp_build=nightly` Now you are ready to run the ansible playbook: ~~~ $ sudo ansible-playbook -i hosts -e ansible_connection=local pulp_server.yaml ~~~ ## Option 2: Using Vagrant with either libvirt or docker See [Pulp Developer Setup](http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html)