PDA

View Full Version : Linux VMs running on Win10+VMwareWorkstationPro



pablolie
2017-12-05, 14:17
This probably a very specialized and a bit esoteric discussion.

But it may help some people who may consider going the same route as I did. I have no Linux based players (which most Linux discussions are about it seems). I have classic Slimdevices and Logitech players. My goal is to keep them running. They rock (IMHO).

I decided to run LMS on a dedicated VM (details in my sig) because I liked the idea of immediate portability; i.e. if I upgrade my main machine, or decide to turn it off or run it elsewhere, al I have to do is spin up the virtual machine (Ubuntu 16.04 with LMS 7.9) elsewhere and it will run, right?

Unfortunately it's not quite as easy, intuitive and immediate. 3 things don't migrate well:

1. Network configuration. Go for bridged. It'll save you a lot of issues with LMS. You have to set that up in the VM management sw, not the vm itself.
2. Music directory visibility to LMS. I have no idea why that is. I would have assumed if you have the same NTFS drive connected to the exact same vm running ubuntu, hey, the fastab stuff should work right away when you connect the external NTFS drive. But that is not so. You'll have to mess about with your fstab again.
3. Network accessibility of your music collection aka Samba configuration. Gone too when you migrate the vm. Odd. I like to have that because I tend to rip new CDs on my Win10 dbPoweramp app, and then easily drop them into the music directory (owned by the Ubuntu VM).

So while that makes my goal of having "immediate migration" ability moot, I shall stick to this configuration model. Simply because, while a tad frustrating at times, it keeps my Linux command line fundamentals going some.

I have noticed that with some recent Ubuntu versions the headache had become less, but some basic stuff in the areas described above remains a tad unpredictable.

Takeaway: don't expect your OVA vm files to transparently work elsewhere, even when you bring the exact same external drive to the table...

drmatt
2017-12-06, 00:24
You can fix #2 by either using "shared folders" in vmware to present local filesystems to the VM (then mount the hgfs volume inside the VM), or what I'd probably do is move all the files into the VM, on a vmdk, and have *it* serve them with samba. Then it does indeed become self contained and portable.


Transcoded from Matt's brain by Tapatalk

d6jg
2017-12-12, 16:26
You can fix #2 by either using "shared folders" in vmware to present local filesystems to the VM (then mount the hgfs volume inside the VM), or what I'd probably do is move all the files into the VM, on a vmdk, and have *it* serve them with samba. Then it does indeed become self contained and portable.


Transcoded from Matt's brain by Tapatalk

Thats going to result in a very very large VMDK File which I would suggest will be impossible to back up as a single entity.

If the host was Linux and not Windows things would be dead easy,

drmatt
2017-12-13, 00:47
Thats going to result in a very very large VMDK File which I would suggest will be impossible to back up as a single entity.

If the host was Linux and not Windows things would be dead easy,Yes. Or several glued together in an LVM volume group (I wouldn't create vmdks bigger than 2TB). Back it up from inside the VM if you prefer, you don't have to back it up as a single entity, it doesn't really matter how you do it. Rsync it to another machine, copy it to backblaze, OneDrive, xfsdump, tar, dar, Bacula, Amanda, whatever. That's a secondary problem no matter how you store it up front.


Transcoded from Matt's brain by Tapatalk

d6jg
2017-12-13, 05:25
Yes. Or several glued together in an LVM volume group (I wouldn't create vmdks bigger than 2TB). Back it up from inside the VM if you prefer, you don't have to back it up as a single entity, it doesn't really matter how you do it. Rsync it to another machine, copy it to backblaze, OneDrive, xfsdump, tar, dar, Bacula, Amanda, whatever. That's a secondary problem no matter how you store it up front.


Transcoded from Matt's brain by Tapatalk

I would suggest that to make it truly portable the VMDK needs to contain just the basic Linux OS, LMS and its preferences and have the music folder elsewhere but connected via NFS or Samba. I agree that the music folder needs to be backed up separately in any one of a number of ways that you suggest (and others).

Portability is a key thing in a Pi based LMS. Provided you use the same NFS / SMB mount then a rebuild is dead easy and takes 5 minutes if you have had the foresight to create a backup of the SD card somehwere.

Returning to the original issue it ought to be possible to share the files on Windows via SMB over the network via UNC IP map. A direct connection to the disc is going to present privilege issues I would think.

drmatt
2017-12-13, 12:03
You could use two vmdks... ;) Yeah I would generally say that's a better idea than lumping it all in one big image.
You could also get the shared folders stuff working. That will always consistently mount the same windows content in the same place anytime you power up the VM.


Transcoded from Matt's brain by Tapatalk

Zounder1
2017-12-17, 11:20
Hm, next time you want to Virtualize LMS, I would strongly suggest you create a VM using Vortexbox.

Vortexbox is a super simple lightweight Linux distribution that includes LMS, Samba shares and a bunch of useful utilities. It is dead simple to install and setup.

I have used Virtualization for over 10 years and I always try and setup VMs that are as lightweight as possible. Each VM is dedicated to one specific purpose. It makes upgrades and maintenance much easier than trying to maintain LMS installed on something like a full install of Ubuntu running a variety of other packages.

Vortexbox website: www.vortexbox.org
Downloads: http://wiki.vortexbox.org/available_images

DJanGo
2017-12-18, 01:30
Takeaway: don't expect your OVA vm files to transparently work elsewhere, even when you bring the exact same external drive to the table...

You cant expect a funtion from a tool thats never designed for this function...

Using the Network in Bridge Mode:
The origin LMS was installed in a Network called 192.168.1.0/24 - whenever someone else who runs his Network under eg. 10.11.12.0/24 you have to "change" something somewhere.
You cant expect a VMWareplayer under win/tux/osx to use the same methods (and devicenames) to find a "external" usb Harddisk.

DJanGo
2017-12-18, 01:39
Vortexbox is a super simple lightweight Linux distribution that includes LMS, Samba shares and a bunch of useful utilities. It is dead simple to install and setup.

I have used Virtualization for over 10 years and I always try and setup VMs that are as lightweight as possible. Each VM is dedicated to one specific purpose. It makes upgrades and maintenance much easier than trying to maintain LMS installed on something like a full install of Ubuntu running a variety of other packages.


Hi,
your 1.st and 2.nd statement didnt match together...
And its not helping any further to this topic - you need to adjust things whenever something outside changes.

There is a lot more brain involved to handle a task like that as just use a out of the box fedore type of "distribution".

Zounder1
2017-12-18, 08:16
Hi,
your 1.st and 2.nd statement didnt match together...
And its not helping any further to this topic - you need to adjust things whenever something outside changes.

There is a lot more brain involved to handle a task like that as just use a out of the box fedore type of "distribution".

How so? Vorterbox by default installs a working LMS server. You can add samba and other utilities if you want or need additional functionality. Vortexbox is a very lightweight distribution based on Fedora. Is does not install a GUI. You use the web interface to interact with it. It has a very small install footprint compared to an Ubuntu workstation install as a result. It is simple to setup. It is simple to run.

So yes statement 1 and 2 match together fine.

As to your comment "its not helping any further to this topic" Well, again, I respectfully disagree. Instead of going the route the OP chose, Vortexbox offers a super simple way to run LMS in a virtualization environment. Ubuntu is an option of course. But I am offering an alternative to what OP did that might help other users thinking of virtualizing LMS.

Based on OP's comments he found setting up LMS on Ubuntu to be a frustrating and likely time consuming. It is great he persevered and got LMS running to his satisfaction on Ubuntu. But for a lot of users they will give up if the learning curve is too steep. Vortexbox does all the heavy lifting and would have addressed all three of his big roadblocks with minimal effort.

For someone that just wants to enjoy their music on LMS, Vortexbox is an option that I strongly recommend.

DJanGo
2017-12-18, 08:26
ok...

Since he only wrotes "Ubuntu" you would think of Ubuntu Desktop and me on Ubunti Server.

For someone that just wants to enjoy their music on LMS Those should go the Windows Way... *lol*

Must be a reason to run a lms on linux on a Windows System.


Takeaway: don't expect your OVA vm files to transparently work elsewhere, even when you bring the exact same external drive to the table...
And that isnt fixed by just using another "distribution" its a "design" challenge...:p

epoch1970
2017-12-18, 12:25
3 things don't migrate well:

1. Network configuration. Go for bridged. It'll save you a lot of issues with LMS. You have to set that up in the VM management sw, not the vm itself.
2. Music directory visibility to LMS. I have no idea why that is. I would have assumed if you have the same NTFS drive connected to the exact same vm running ubuntu, hey, the fastab stuff should work right away when you connect the external NTFS drive. But that is not so. You'll have to mess about with your fstab again.
3. Network accessibility of your music collection aka Samba configuration. Gone too when you migrate the vm. Odd. I like to have that because I tend to rip new CDs on my Win10 dbPoweramp app, and then easily drop them into the music directory (owned by the Ubuntu VM).
I don't use VMWare and I don't like Ubuntu all that much, but in general:

1. Yes bridge the guest to a physical network card on the host, and set the guest to DHCP. Make sure the hypervisor assigns the same MAC address to the guest across different VMWare installs, otherwise the ubuntu machine is going to create "eth1" where "eth0" was formerly used. (If you run into that, go to /etc/udev/rules.d/, remove file 70-persistent-net.rules and reboot. The network card will be called eth0 again.)
Same problem if the Ubuntu guest uses the so-called Predictable Network Interface Names. Actually the problem is possibly worse since there are different naming schemes for PNIN... In the guest I would try disabling that junk (https://unix.stackexchange.com/questions/335461/predictable-network-interface-names-break-vm-migration) or use the ludicrous "device name is enxMAC_address" policy, along with specifying the same MAC in VMWare across installs.
Now the guest normally will only change network IP address across installs, e.g. IP 192.168.0.45 in one install, 10.240.0.150 in another, etc.

2. I understand this is a physical USB drive exported by VMWare to the guest? It is quite possible that the device path/name inside the guest changes from install to install. However a mount in fstab that would use higher-level information like UUID= (will change if you reformat the partition) or LABEL= (not available on all filesystems, ok on NTFS AFAIK) should work across instances.
If the drive is exported as an USB device (and not as, say, a SATA device) then in addition the guest might feel like being smart, mount the volume to /media/somename and disregard your fstab entry. I would export the physical device as a SATA/SCSI device if possible, otherwise expel from the guest OS any pesky "USB mount helper"

3. If the SMB shares use names, e.g \\DESKTOP\music or \\MYVM\newstuff then there shouldn't be a problem. If sharing/mounting by IP address, there could be a problem across installs?

DJanGo
2017-12-18, 13:05
3. If the SMB shares use names, e.g \\DESKTOP\music or \\MYVM\newstuff then there shouldn't be a problem. If sharing/mounting by IP address, there could be a problem across installs?

To use e.g \\DESKTOP\music - you'll need an active local dns Server.....
Most of the homeusers / people who think they need "that" sort of howto didnt know nothing about setting up a DNS Server.

epoch1970
2017-12-18, 18:06
To use e.g \\DESKTOP\music - you'll need an active local dns Server.....
Most of the homeusers / people who think they need "that" sort of howto didnt know nothing about setting up a DNS Server.
WINS name resolution will take care of that, itís built in Windows machines. No need for a DNS server.
(Not that it's superior in any way, but at some point in time MS thought they could own networking and the internet. They created WINS and itís still there, AFAIK.)

drmatt
2017-12-19, 01:29
This stuff is entirely why I suggested hgfs mount in the first couple of posts...


Transcoded from Matt's brain by Tapatalk

DJanGo
2017-12-19, 01:34
WINS name resolution will take care of that, it’s built in Windows machines. No need for a DNS server.

Wins has "just the same (in this case)" as DNS" - to use it youll need to setup a Winsserver with a static IP for all the clients.
To activate wins in these days you'll need more steps than DNS - eg. The Winsserversettings in your NIC IP Configuration is only in the extended Parameters available.

epoch1970
2017-12-19, 03:39
Yes my bad, it's not WINS, it's in the regular Netbios protocol.
Works via broadcasts over the LAN.
https://support.microsoft.com/en-us/help/119493/netbios-over-tcp-ip-name-resolution-and-wins
https://support.microsoft.com/en-us/help/172218/microsoft-tcp-ip-host-name-resolution-order

Looks like the OP left the building anyway. He's probably right.

pablolie
2017-12-24, 07:41
I have been reading the different suggestions with great interest.

There are man ways to skin this particular cat indeed. :-)

The main lesson is that it isn't as straight-forward as I thought it would be, as evidenced by all the replies, too.

I have decided to create an entirely new VM over the holidays using some of the advice in here. Hopefully that makes the VM more versatile.

Happy Holidays, Linux brethren :-)

pablolie
2017-12-26, 12:34
FYI for now I have disabled the VM and simply spun up the Windows LMS app - it's far less trouble right now.

That said I will most definitely re-create an Ubuntu VM with better built-in portability, but it will require a little research. :-) Fact of the matter is that the old VM has been very temperamental in the new environment, with shared directories crapping out, mysteriously changed permissions and so on. So I'll start from scratch.

Biggest issue for sure is the fact that shared, networked directories disappear without rhyme or reason. When I tried to fix that LMS stopped working altogether, so it was time to kill the VM and start from scratch. It's bizarre because I distinctly remember how pleased I was with getting the VM to work so smoothly on the first install. I had never realized how poor documentation on Ubuntu, fstab and samba is. Guess it justifies the fact I am currently getting a Linux Foundation administrator certification (just for fun, not for career reasons). :-D

...p