 So, I do a lot with virtual machines. I install a ton of operating systems in virtual machines and it's great for testing out new Linux distributions or sometimes testing out potentially dangerous things that you wouldn't want to do on physical hardware, on your production machine. It makes sense sometimes just to spin up a virtual machine to test things out in. And I have two virtualization programs installed on my system. I have VirtualBox, which works on Windows, Mac, and Linux. And I also have VertManager, which is a virtualization program specifically designed for Linux. And most of the virtual machines I create, I actually use VertManager for. I much prefer it to VirtualBox. The reason I like VirtualBox and often mention VirtualBox on my videos is because I know many people that watch my content are Windows users or Mac users that are thinking about coming over to Linux. And if those guys want to try out a Linux distribution, for example, inside a virtual machine, then they would want to use something like VirtualBox because they can't actually use VertManager. VertManager has to be run on a Linux host. Now, I've done a previous video about VertManager in the past on how to install it and set it up on Linux. Today, I want to dive a little deeper. I want to cover just a few quick topics today. I want to talk about cloning virtual machines. I want to talk about how to convert your existing VirtualBox images over to images that VertManager can handle. And I'm also going to talk about how to connect your USB devices. And we're going to create shared folders between your host machine and your guest machines as well. So let me switch over to my desktop. And I've got VertManager open here. You can see I have a number of virtual machines here that I keep around for testing purposes. You can see that all of these virtual machines are QEMU slash KVM type virtual machines. So what is KVM? That is the kernel virtual machine, meaning that inside the Linux kernel itself, there are certain modules that are actually virtualization modules, meaning essentially the Linux kernel has the ability to create virtual machines. And that is why these KVM virtual machines that run in VertManager, they have some performance increases compared to virtual machines that you would run in VirtualBox, for example. Because VirtualBox, of course, can't really access the Linux kernel in any way. So that is the advantage if you're a Linux user of using VertManager and these KVM virtual machines. Now, the first thing I want to show you guys is how to connect a USB device. Because that's one of the most common things when I tell people about virtual machines and they first start trying them out is, hey, how do I connect my USB external hard drive or my thumb drive or various USB peripherals to my virtual machines? Well, VertManager makes this really easy. It's much easier than even in VirtualBox because really it's taking one thing in a menu and your USB devices should just work. So I'm going to plug this into my computer. That is a USB drive that has ARCO Linux actually installed on that. And I'm telling you what's installed on it so you can verify it when I connect to this virtual machine. So I'm going to start this Manjaro KDE virtual machine and let's make that full screen. I'm not going to make it entirely full screen. I'm going to keep the menu up for a second because we will need this menu in a second. So let me log in. All right. Now that we have logged in to Manjaro KDE, what I'm going to do is I'm going to go up here and I'm going to go to redirect USB device. And when you click on that, you have all the current USB devices that are connected to my computer. And I can turn any of them on. Oddly enough, there are a couple of devices in here that are actually working inside the VM currently, like my Moonlander, which is my keyboard, and then my Kensington Expert, which is my trackball mouse. I mean, I'm using the trackball right now. So I don't actually have to tick these on. They're already working. But some things are not going to work. For example, this SanDisk 16 gigabyte USB stick that I plugged in is not currently going to be shown inside Manjaro unless I tick that on. And then I close this. And now let me go ahead and make this properly full screen. And you saw the disks and devices pop up here in KDE that was letting me know, hey, we just plugged in a new device. I could also go into the Dolphin File Manager here. And in the far left-hand corner here, you see Arco Linux B extended edition. And if I click on it, yeah, there is what is actually on that USB stick that we plugged in. So that is how you connect your USB devices. Now I shut down that virtual machine, the KDE Manjaro virtual machine. Now I want to show you how to clone a virtual machine because this is dead simple to do. And it's something I don't think enough people fully utilize because when I'm testing things, when I'm testing software, when I'm testing scripts and things like that, that I don't want to necessarily execute inside a physical machine on real hardware, I want to do this inside a virtual machine. So here's the thing. Say I test something that's kind of dangerous and then it completely hoses my virtual machine. Well then I've got to reinstall, in this case, Manjaro KDE, set up a new virtual machine. Now the Linux installations these days, they only take 10, 15 minutes typically, but that's still 10 or 15 minutes worth of time that is wasted now because I have to go and set up a new virtual machine to test that piece of software again and it may break the virtual machine again. So what you want to do is keep clones of your VMs around. For example, I do a lot of testing on these arch-based distributions. That's why I have so many arch-based VMs here. And specifically, I keep these around for DTOS testing. So what I do is I set up a fresh installation of Manjaro KDE, I know it's up to date. And then I right click on it and I choose clone and then I could give it a different name by default. It's going to call it Manjaro KDE clone. That's fine. Now this is going to take about a minute or two and that took about a minute. And now we have this new Manjaro KDE clone VM. And again, I think that's very important is one of the things and I don't do enough sometimes stressing the importance of this because I often tell you guys to if it's your very first time installing something like Arch or Gen2 or you know, some distribution like that Nix, hey, try it out in a virtual machine. You know, you guys that are playing around with Linux from scratch, for example, that are going to take several days or several weeks sometimes to install that particular distribution. You're typically doing that in a VM and it's nice sometimes when you get to a stopping point and you know you're good up to this point, clone the virtual machine. That way if from that point you do something dumb and actually break things, well, at least you kind of have a snapshot to go back to. I find this, I often use this with Gen2 installations inside virtual machines where I do the Gen2 base install and then I clone it that way I've got that forever. And then I do the Xorg install which takes a long time and if I get Xorg up and running I get a graphical server then I take a snapshot of Gen2 at that point. That way I've got a couple of snapshots that I can always go back to if I need to. Now let me show you how to get shared folders working. Shared folder is a folder on your physical machine, your host machine that is available inside your virtual machine. That way you can edit the same files, you know, on both the host machine and the guest machine. It's actually a really nice feature. So once again let me switch over to my desktop here. So obviously this is my host machine, you see VertManager running. Let me go ahead and open a terminal here on my host machine. And the first thing you need to do on your host machine is make a directory that you know is going to be shared. It can be named anything, I'm going to make a directory and I'm going to call it share. That's just typically what I always call this directory. The next thing I want to do is I want to chmod 777 share. So we've set the permissions for read, write, execute, anybody can do anything in this directory. And this is very important. We want any user to be able to do anything in that directory because the user names could be different between the host machine and the virtual machine. So if I did a ls right now in my home directory, I should see somewhere in here a folder called share. Now if I cd into share and do an ls, there is nothing in it. So let me clear the screen here. What I'm going to do inside our new share directory is I'm going to just create a new file, I'll call it test.txt and I'm just going to insert some text. This is a test exclamation. Let me go ahead and write and quit out of that. So now that we have this share folder and we have a test file in it, let me close the terminal. I won't need that anymore on the host machine. Now the virtual machine. So I think I'm going to do this manjaro kde clone that we just cloned. So this is a fresh cloned VM. And then I'm going to go into the hardware details. So the second box here, and let me make this full screen here. And then I'm going to go down at the bottom, add hardware. Let's add and we want to add a file system. So click on file system and type is mount mode is mapped. You definitely want mode to be mapped because that gives you right access to the guest. So and then you have source path, which is the folder on your host machine and the target path, which is the folder or the mount point actually in the VM. So the source path is easy. Just click browse, browse local and then just find that directory you created. If you called your directory share, look for share and just click on it, click open and you see slash home slash dt slash share. That is the source path. And then the target path, you can name this anything. This is going to be a mount point. What I'm going to do is I'm going to do slash share point. So inside the VM, I'm going to create a mount point at some point and it's going to be share point. And then click finish and then click play to start the VM. Let me switch over to the virtual machine view. I'll make it full screen here. All right. And manjaro has started up. Now inside manjaro kde, I'm going to control alt t to bring up a terminal and let me zoom way in so you guys can see what I'm going to do here. So what I'm going to do here is I need to make a directory on this machine as well. So I'm going to mkdir make dear and it needs to be share by doing LS. You see our new share directory right there. And then the next command we're going to enter is a long and convoluted command. It's one of those things. You probably want to jot it down in some notes. For me, I have it saved in some vert manager notes that I have saved in an org mode document because I use this command all the time, but it's too long. I never remember the exact flags or the order of things, but it is sudo space mount. And you could do this either as the root user or as your home user using sudo privileges. I'm going to use sudo space mount space dash t for type space in p. So this is, I think the file system type is letting it know that this is a virtualized file system, I believe. I think 9p actually has something to do with plan nine. I could actually look in the man page of mount and probably find that information out, but it's not really important. Just know that anytime you're doing the shared folders inside vert manager, it's mount space dash t space 9p and then space dash o. And then after the dash o flag, we're going to do trans equals vert IO no spaces in between the equal. So trans equals vert IO space and then the mount point, remember it was slash share point. That is what we put as the target source in the settings of the VM, right? Remember that and then space and then the name of the folder we created. Remember that is share and if everything works correctly, yeah, no errors were returned by data LS here in the home directory. There is the share directory that we made earlier by CD and to share and do a LS. How about that? There is test dot txt. And remember, we just made this directory. It should have been empty, but when we mounted it, it is actually connecting that share directory to the share directory on my host machine. And there is the file we created earlier. Remember the first line of it is this is a test exclamation. There it is. This is a test exclamation. If I wanted to add something, this is a new line exclamation. I could write and quit. If I wanted to, let me get to a new workspace here. And this is my host machine. I'm going to CD into the share directory on my host machine. And once again, VM, if I can type test dot txt, we do not have privileges, though. If I did a LS, you see the owner of this file is nobody. So I either have to open this as root because root has root permissions or I would have to change the owner of this file to the DT user. I would just do a sudo of vmtest.txt. And you see now I can actually read the file. I could edit the file and any edits that I make would take effect on the virtual machine as well. So that is one way to do shared folders. Now another way to do shared folders is instead of having to always mount every time you open this virtual machine, wouldn't it be great if it just auto-mounted every time you launch the virtual machine? And of course to have a drive auto-mount, essentially what the shared folder is, is like a auto-mounting drive, of course you need to edit the fstab, the file system table. So what I'm going to do is I'm going to sudo vm slash etsy slash fstab. And what we're going to do is we're going to create a entry for this shared folder. And it needs to read like this. It's going to be slash share point. And then tab over. And then it's going to be the path to the directory. In my case I think it's going to be slash home slash dt slash share. And then tab over. And that should be the type. Remember the type is 9p. And then tab one more time. And then add the trans equals vertio comma version equals 9p 2000 dot capital L comma rw. And yes, I had that saved in my notes too. That was a rather lengthy thing to type to. And then tab over zero, tab over zero. And then write and quit that. And if this works, let's see if this actually works. What I'm going to do is I'll force the vm to shut down just to make the shutdown a little quicker. And then I will restart the vm. And the machine has rebooted. I don't think the mounting worked. Let me get into the home directory. There is share. And if I click on it, yeah, we're still mounted. Because there is test dot txt. If I created something here. So let me create a new text file. And I'll call this test to dot txt. And let's go back to the host machine and actually see if that took effect. So let me switch to a new workspace, cd into share, ls, yeah, test dot txt and test to dot txt. So it did work. I was a little concerned that it didn't work because when I rebooted the machine, it actually did complain a little bit that it could not mount slash home slash dt slash share. But I don't know why the error message came up on boot because it clearly was able to mount it. Because otherwise we wouldn't have the ability to share these files. So that is a couple of different ways that you can set up your shared folders. And of course that'll allow you to share files between the host machine and the guest machine. Of course you can also share files between the host and the guest using the USB method I showed you earlier because now you have the ability to plug in your USB sticks or your USB external hard drives and things like that to move files and folders around if you need it. And the last tip I wanna leave you guys with is I'm gonna show you the command to convert your virtual box virtual machines over to virt manager virtual machines. So let me switch back over to my desktop. Of course this is virt manager. Let me go ahead and launch virtual box because I'm not sure what machines I have inside virtual box. I don't use it that often. And I have this Lubuntu virtual machine here inside virtual box. So what I'm gonna do is I'm gonna convert that Lubuntu virtual machine over to virt manager. So let me open a terminal. Let me make the terminal full screen and I'm gonna zoom way in. I've gotta run a long kinda convoluted command once again but it's one of those things. Again, just write it down, save it in your notes. That way you have this command if and when you need it. So as root or with sudo privileges, I'm gonna use sudo because I have sudo privileges on this machine. I'm gonna do sudo space QEMU-IMG. So QEMU image, right? And space convert space dash F space VDI. So we're gonna convert a VDI image, which is the virtual box disk image. And what are we gonna convert it to? Dash capital O space. We're gonna convert it to the QCal2 format. That is the format for the disk images that virt manager uses. And then we needed to give it the name of the virtual box disk image. And I believe the VM was called Lubuntu with a capital L dot VDI. If there would have been numbers and spaces in there, it would have been one thing. I could actually verify that that is the correct path. I'm gonna open a second terminal and a CD into virtual box VMs in my home directory. If I do an LS, you can see that is where the VMs actually live by CD into the Lubuntu folder. And doing LS, there is the disk image, Lubuntu dot VDI. So that was the correct name. So I guessed right, but you should probably verify that before trying the command. And then what we need to do is give it the path to the disk image when it's converted over to a virt manager image. Now, virt manager saves everything in slash var slash lib slash libvert slash images slash. And then if I tab complete, you can see the names are usually the virtual machine name that I gave it dot QCal to. So in this case, I'm gonna call this new VM Lubuntu dot QCal to. If I hit enter, it's gonna ask for a root password. And I got an error because it says it could not open Lubuntu dot VDI. What it is is we need to actually CD into virtual box VMs. And probably even CD into Lubuntu because that is where the Lubuntu dot VDI file is. And then what I'm gonna do is I'm gonna up arrow and rerun this command. And now it's gonna work. It's gonna take a few minutes. You know, it's cause it's converting basically a hard drive, a hard disk image, even though it's a virtual disk image to another. On my threadripper, actually it didn't take that long, but on weaker machines, it could actually take quite some time. And of course, the conversion time is gonna depend on how big the VMs are as well that Lubuntu VM wasn't very big. So now let me get out of the full screen here. I'm gonna close that terminal. And now that we've got that Lubuntu disk image, what I would need to do is I would need to go up in here and do new virtual machine from ISO or CD-ROM. Actually, no, what we need to do is import existing disk image. And then forward and then browse for that disk image. I'm gonna browse local. And you remember where we need to browse? We're gonna go into the root file system and we need to browse slash var slash lib slash libvert slash images and then look for the new Lubuntu QCal image. Then choose the operating system. This is an Ubuntu based operating system. I think it's one of the older ones, probably the Ubuntu LTS. Click forward, give it the CPU and the RAM. And I will call this Lubuntu. I'm not sure what version it is. I'll just call it Lubuntu and then finish. And then if our conversion from the virtual box disk image over to the QCal format actually worked, we should actually, yeah, this is Lubuntu. So that converting that only took just a few minutes. And actually I wasted several seconds by not typing the full path to that disk image. So really, really easy to convert virtual box over to Vert Manager. So that's just a few tips and tricks with Vert Manager. Again, I use it all the time because I create so many virtual machines. And I know a lot of you guys are probably using it. And many of you guys probably have already discovered some of what I talked about today, but hopefully a few of you guys gleaned some extra knowledge maybe you didn't have before watching this video. Now before I go, I wanna thank a few special people. I wanna thank the producers of this episode. Devon Gabe, James Met, Michael Mitchell, Paul Scott Wess. I also wanna thank Akami Allen, Lennox Ninja Chuck, Commander Ingrid Kurt, Diocca, David Dylan, Gregory Heiko, Kaskali, Maxim, Mike, Nitrix, Erion, Alexander, Peace, Arch of the Door, Polytape, Raver, Red Prophet, Steven and Willie, these guys, they're my highest tiered patrons over on Patreon without these guys. This episode you just watched would not have been possible. The show's also brought to you by each and every one of these ladies and gentlemen as well. All these names you're seeing on the screen. These are all my supporters over on Patreon because I don't have any corporate sponsors. I'm just sponsored by you guys, the community. So if you like my work and wanna support me, well, I should probably do the ending scenes in the correct order. If you like my work and wanna support my work, please subscribe to DistroTube over on Patreon. This time I will actually switch to the ending scene at the right time. All right, peace. You're slipping, DT, you're slipping.