ArildS
Contributor
Contributor

How to install Samba server on ESX 4 (vSphere 4)

VMWare does not support samba server and do not include the required RPMs in the ISO image.

As we know samba is riddled with security problems and it's usage is frowned upon

However, if used in a responsible manner. I.e behind firewalls it should be safe. DON'T use it on an ESX conneted directly to the internet. Actually you better not connect your ESX servers directly to the internet at all.

-


> USE AT YOUR OWN RISK!!! <----


Also you may affect ESX stability by using unsupported RPMs and void the VMWare support license by using them.

Samba on ESX 4 for dummies:

Download the required RPMs from the ISO image and/or the Centos FTP site: (as new versions arrive find the right Centos distro)

You will need (in this order):

samba-common-3.0.28-1.el5_2.1.x86_64.rpm (is in the iso)

cups-libs-1.2.4-11.18.el5_2.3.x86_64.rpm

samba-3.0.28-1.el5_2.1.x86_64.rpm

Upload the files to your ESX server with an FTP client and use port 22 (Filezilla is great). Connect with a valid user (not Root) and use port 22.

Use these commands to install (in this order):

rpm -Uvh samba-common-3.0.28-1.el5_2.1.x86_64.rpm

rpm -Uvh --nodeps cups-libs-1.2.4-11.18.el5_2.3.x86_64.rpm

rpm -Uvh samba-3.0.28-1.el5_2.1.x86_64.rpm

To set up samba to use it you'll need this info if you are a dummy Smiley Happy

1.Open the firewall in ESX: esxcfg-firewall -o 445,tcp,in,smb-server

(you could also make scripts to open/close fw for every use)

2. Edit the smb.conf: nano /etc/samba/smb.conf

(you may need something like this under Share Definitions. Use [ before the labels vmfs and vmimages)

vmfs]

comment = vmfs

browseable = yes

writable = yes

valid users = root

path = /vmfs/volumes

vmimages]

comment = vmimages

browseable = yes

writable = yes

valid users = root

path = /vmimages

3. Turn samba on: chkconfig --level 3 smb on

4. Start samba service: /etc/init.d/smb start

5. Restart the FW: /etc/init.d/firewall restart

6. Set root smb password: smbpasswd -a root

This concludes the Samba in ESX 4 guide for real dummies Smiley Wink

Message was edited by: ArildS

0 Kudos
17 Replies
puzzledtux
Hot Shot
Hot Shot

I would rather setup a new Linux virtual machine and configure samba in it. By installing samba packages on the ESX directly one would be breaking the VMware support clause.

0 Kudos
AntonVZhbankov
Immortal
Immortal

Service Console in ESX is a kind of Linux machine, yes. But do not use it other than for monitoring or troubleshooting purposes.

If you want Samba server then create VM, install Linux and setup samba


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
ArildS
Contributor
Contributor

Agreed. Personally I only install Emulex management on my ESX hosts.

This samba guide was only for those dummies that really desperately need it for simplicity.

0 Kudos
AntonVZhbankov
Immortal
Immortal

>need it for simplicity.

Сan't agree. Is it so difficult to install Windows in VM or Linux? Any additional software you have installed in Service Console add complexity to your environment.

You can migrate VM, backup it, snapshot it, clone etc. You can't do this to samba in Service Console, actually you lose all your virtualization benefits. What if ESX fails? What if you want to move all your VMs and services to brand new powerful cluster with ESXi embedded?


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
ArildS
Contributor
Contributor

What I mean by simplicity here, is simply a SIMPLE and FAST way to move the files we NEED to move TO/FROM all the ESX hosts in our current (but old fashion) setup. Nothing more.

I'd set this up for my corporals when I'm on vacation so they are not totally bound on hands and feet. It's always nice to have some battery capacity left in the mobile when the vacation is over

For the expert there sure is other/better ways. Hence a 'How to for DUMMIES!'.

Please post a different more secure and as fast to use 'How to for dummies', and I mean real dummies, and I'll be first in line to try it on my own dummies

(The dummies here being Windows users with next to no Unix/Linux experience)

>What if ESX fails?

I have many so if one dies I'd survive if I used this extensively (which I don't)

>What if you want to move all your VMs and services to brand new powerful cluster with ESXi embedded?

Hurdle for the future?

0 Kudos
AntonVZhbankov
Immortal
Immortal

Just use Veeam FastSCP. It's free, has very simple to understand GUI interface and you can just copy/paste files like in Windows Explorer.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
ArildS
Contributor
Contributor

Sounds promising. How fast is it when moving TB of data in your experience?

0 Kudos
AntonVZhbankov
Immortal
Immortal

SCP implementation in ESX is not fast, VMware is gonna fix it. But I wonder, are there any engineers with "dummy" level knowledge and terabytes of data?

In most cases there is better way than setup samba on ESX. Just imagine that you have ESXi only, and there is no way to install samba here. What would you do?

Yes, you can actually setup samba in ESX Service Console, but this is bad practice, and some "dummy" will pay for it just because he didn't take couple of hours planning. In my opinion, this is not what newbies should learn.

In some cases your solution can be the best possible, but not all, and it should not be marked as best practice, especially for newbies.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
ArildS
Contributor
Contributor

>SCP implementation in ESX is not fast, VMware is gonna fix it. But I wonder, are there any engineers with "dummy" level knowledge and terabytes of data?

I'll look into it when it's faster. Thanks. I have TBs, and my corporals are dummy level, that is my problem with limited resources 😛

>In some cases your solution can be the best possible, but not all, and it should not be marked as best practice, especially for newbies.

Agreed. That's why I clearly stated that it is not the best of ideas and :USE AT YOUR OWN RISK!

Our discussion here should also alert newbies to the dangers both to ESX stability and security, which is a good thing :smileygrin:

For ESXi I guess SCP might be the only simple alternative.

0 Kudos
jasoncllsystems
Enthusiast
Enthusiast

I would said you shouldn't posted here.

Used at your own risk and good luck!

Regards,

Jas aka Superman

MALAYSIA VMware Communities

'If you found this or any other answer useful please consider allocating points for helpful or correct answers ***

http://www.malaysiavm.com
0 Kudos
ArildS
Contributor
Contributor

Noted. By now this discussion is displaying a lot of negative input on doing this so most should be warned off from doing it.

On a side note, the Samba service can be turned off when a user is finished moving data to close holes and maintain stability. I made some scripts for my corporals to do that easily thus Samba is only up when REALLY needed.

0 Kudos
LucasAlbers
Expert
Expert

A samba server should be stable. If only one user is connecting to it, it will only max out the cpu one one samba process running as that user.

It could potentially use up server console memory.

Wouldn't ftp be a faster alternative?

0 Kudos
Andr3y
Enthusiast
Enthusiast

Good day Anton,

Sorry to raise this topic again.

In my test lab I have one server which acts as ESX server and Windows Server at the same time. So I still have 2 out of 3 HD's configured as NTFS which contain Win server setup and most of my data. Will this example be a best solution in combination with ntfs-3g to mount my NTFS partitions? I only have 1-2 users accessing the partition from time to time.

Or is there another more stable solution via VM somehow?

Thank you,

Andrey

0 Kudos
AntonVZhbankov
Immortal
Immortal

Yes, of course Windows VM with RDM disks gives you more flexibility and stability. Less you touch service console - less possible problems in the future.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
Andr3y
Enthusiast
Enthusiast

Thanks heaps Anton,

Your suggestions is very easy to implement and works great.

Andrey

0 Kudos
nitsi
Contributor
Contributor

I have an esxi 4 last update my problem is that there is no bin of rpm.

how can i install the rpm bin?

0 Kudos
aa2k
Contributor
Contributor

Thanks for your great guide!!! ... I just finished installing it on ESX 4.1, but I had to adjust a few things to make it work with the new version, some updated packages I needed to install, just google the package name and its easy to find:

Follow same steps from original poster, if you want to install dependencies for cups-libs, install these first:

The package "samba-common-3.0.28-1.el5_2.1.x86_64.rpm" is already installed on the new version esx 4.1, to check its there just run "rpm -q samba-common".

Install the following 3 packages/dependencies ONLY if you want to install cups-libs with dependencies, otherwise use the --nodeps option when installing cups-libs:

rpm -Uvh libjpeg-6b-37.x86_64.rpm

rpm -Uvh libpng-1.2.10-7.1.el5_5.3.x86_64.rpm

rpm -Uvh libtiff-3.8.2-7.el5_5.5.x86_64.rpm

If using with the mentioned dependencies install:

rpm -Uvh cups-libs-1.3.7-11.el5_4.5.x86_64.rpm

If not using the dependencies install :

rpm -Uvh --nodeps cups-libs-1.3.7-11.el5_4.5.x86_64.rpm

rpm -Uvh perl-Convert-ASN1-0.20-1.1.noarch.rpm (this package is needed now)

rpm -Uvh samba-3.0.33-3.15.el5_4.1.x86_64.rpm

To set up samba and use it you'll need to open extra ports for this version (4.1):

1. Open the following firewall ports in ESX:

esxcfg-firewall -o 445,tcp,in,smb-server (as original poster, if you do this port only it works but you wont be able to see the samba shares on Windows Networks)

Open these ports as well and samba shares will be visable on Windows Network and other Unix boxes:

esxcfg-firewall -o 445,tcp,out,smb-server

esxcfg-firewall -o 445,udp,in,smb-server

esxcfg-firewall -o 445,udp,out,smb-server

esxcfg-firewall -o 137:139,tcp,in,smb-server

esxcfg-firewall -o 137:139,udp,in,smb-server

esxcfg-firewall -o 137:139,tcp,out,smb-server

esxcfg-firewall -o 137:139,udp,out,smb-server

2. Edit the smb.conf as noted on the original poster:

3. Follow same steps as original poster.

NOTE: You may see these warning messages after installing some packages, just ignore them, everyting works.

/sbin/ldconfig: /usr/lib/libkrb4.so.2 is not a symbolic link

/sbin/ldconfig: /usr/lib64/libkrb4.so.2 is not a symbolic link

To query firewall open ports run:

esxcfg-firewall -q

In my setup I had an Ubuntu server acting as WINS server, so on this ESX server under "smb.conf" I added the option of "wins server = <my ubuntu server ip>", not sure if it matters but I mention it.

Cheers! and thanks for such a great guide!

0 Kudos