https://wiki.archlinux.org/api.php?action=feedcontributions&user=Trishika&feedformat=atomArchWiki - User contributions [en]2024-03-29T10:45:35ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Awesome&diff=176824Awesome2012-01-04T09:20:44Z<p>Trishika: /* Debug rc.lua using Xephyr */</p>
<hr />
<div>[[Category:Dynamic WMs (English)]]<br />
{{i18n|Awesome}}<br />
[[fr:Awesome3]]<br />
{{Lowercase title}}<br />
<br />
{{Article summary start}}<br />
{{Article summary text|A guide on how to install, use, configure, and customize awesome window manager.}}<br />
{{Article summary end}}<br />
<br />
From the [[Wikipedia:awesome (window manager)|awesome]] website:<br />
<br />
"''[http://awesome.naquadah.org/ awesome] is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license.''<br />
<br />
''It is primarly targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on its graphical environment.''"<br />
<br />
==Installation==<br />
<br />
[http://aur.archlinux.org/packages.php?ID=41362 awesome] is available in the [[AUR]], due to its dependency on the unsupported cairo-xcb package. If you want unstable pre-release versions, you can install the [http://aur.archlinux.org/packages.php?ID=13916 awesome-git] package instead.<br />
<br />
==Getting Started==<br />
<br />
===Using awesome===<br />
To run awesome without a login manager, simply add '''{{Ic|exec awesome}}''' to the startup script of your choice (e.g. ~/.xinitrc.)<br />
<br />
If you have problems with some devices (like mounting usbkeys, reading dvds) be sure to read documentation about [[HAL]] and [[PolicyKit]]. When you do not use a login manager, nothing is automated. In some cases, using '''{{Ic|exec ck-launch-session awesome}}''' can solve your problems. For this to work, you must have the {{Pkg|consolekit}} package installed, otherwise '''ck-launch-session''' will be an unrecognised command. See [[ConsoleKit]].<br />
<br />
To start awesome from a login manager, see [[Display Manager|this article]]. <br />
<br />
'''[[SLIM]]''' is a popular lightweight login manager and comes highly recommended. You should do like this:<br />
<br />
1) Edit /etc/slim.conf for start awesome session, add awesome to sessions line. <br>For example: <br />
sessions awesome,wmii,xmonad<br />
2) Edit ~/.xinitrc file <br />
DEFAULT_SESSION=awesome<br />
case $1 in<br />
awesome|wmii|xmonad) exec $1 ;;<br />
*) exec $DEFAULT_SESSION ;;<br />
esac<br />
However, you can also start awesome as preferred user without any login manager and even without logging in, after editing ~/.xinitrc and /etc/inittab properly. Refer to the article [[Start X at boot]].<br />
<br />
==Configuration==<br />
Awesome includes some good default settings right out of the box, but sooner or later you'll want to change something. The lua based configuration file is at {{Ic|~/.config/awesome/rc.lua}}.<br />
<br />
===Creating the configuration file===<br />
First, run the following to create the directory needed in the next step:<br />
$ mkdir -p ~/.config/awesome/<br />
<br />
Whenever compiled, awesome will attempt to use whatever custom settings are contained in ~/.config/awesome/rc.lua. This file is not created by default, so we must copy the template file first:<br />
$ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/<br />
<br />
The syntax of the configuration often changes when awesome updates. So, remember to repeate the command above when you get something strange with awesome, or you'd like to modify the configuration.<br />
<br />
For more information about configuring awesome, check out the [http://awesome.naquadah.org/wiki/Awesome_3_configuration configuration page at awesome wiki]<br />
<br />
===More configuration resources===<br />
{{Note|The syntax of awesome configuration changes regularly, so you will likely have to modify any file you download.}}<br />
<br />
Some good examples of rc.lua would be as follows:<br />
<br />
* http://git.sysphere.org/awesome-configs/tree/ - Awesome 3.4 configurations from Adrian C. (anrxc)<br />
* http://pastebin.com/f6e4b064e - Darthlukan's awesome 3.4 configuration. <br />
* http://www.calmar.ws/dotfiles/dotfiledir/dot_awesomerc.lua<br />
* http://www.ugolnik.info/downloads/awesome/rc.lua (screen) - Awesome 3 with small titlebar and statusbar.<br />
* http://github.com/nblock/config/blob/master/.config/awesome/rc.lua<br />
* User Configuration Files http://awesome.naquadah.org/wiki/User_Configuration_Files<br />
<br />
===Debug rc.lua using Xephyr===<br />
<br />
This is my prefered way to debug rc.lua, without breaking my current desktop. I first copy my rc.lua into a new file, rc.lua.new, and modify it as needed. Then, I run new instance of awesome in Xephyr (allows you to run X nested in another X's client window, supplying rc.lua.new as a config file like this:<br />
<br />
$ Xephyr :1 -ac -br -noreset -screen 1152x720 &<br />
$ DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua.new<br />
<br />
Big advantage of this approach is that if I break rc.lua.new, I do not break my current awesome desktop (and possibly crash all my X apps, lose all unsaved things and so on...). Once I'm happy with my new settings, I move rc.lua.new to rc.lua and restart awesome. And I can be sure it will work and restarting with new config won't mess up things.<br />
<br />
==Themes==<br />
<br />
[http://awesome.naquadah.org/wiki/Beautiful Beautiful] is a lua library that allows you to theme awesome using an external file, it becomes very easy to dynamically change your whole awesome colours and wallpaper without changing your rc.lua. <br />
<br />
The default theme is at /usr/share/awesome/themes/default. Copy it to ~/.config/awesome/themes/default and change theme_path in rc.lua. <br />
<br />
More details [http://awesome.naquadah.org/wiki/Beautiful here]<br />
<br />
A few sample [http://awesome.naquadah.org/wiki/Beautiful_themes themes]<br />
<br />
===Setting up your wallpaper===<br />
<br />
Beautiful can handle your wallpaper, thus you do not need to set it up in your .xinitrc or .xsession files. This allows you to have a specific wallpaper for each theme. If you take a look at the default theme file you'll see a wallpaper_cmd key, the given command is executed when beautiful.init("path_to_theme_file") is run. You can put here you own command or remove/comment the key if you do not want Beautiful to interfere with your wallpaper business.<br />
<br />
For instance, if you use awsetbg to set your wallpaper, you can write in the theme.lua page that you just selected:<br />
<br />
wallpaper_cmd = { "awsetbg -f .config/awesome/themes/awesome-wallpaper.png" }<br />
<br />
{{Note|For awsetbg to work you need to have a program that can manage desktop backgrounds installed. For example '''[[Feh]]'''.}}<br />
<br />
====Random Background Image====<br />
To rotate the wallpapers randomly, just comment the wallpaper_cmd line above, and add a script into your .xinitrc with the codes below:<br />
{{bc|<br />
while true;<br />
do<br />
awsetbg -r <path/to/the/directory/of/your/wallpapers><br />
sleep 15m<br />
done &<br />
}}<br />
<br />
==Tips & Tricks==<br />
Feel free to add any tips or tricks that you would like to pass on to other awesome users.<br />
<br />
===Use awesome as GNOME's window manager===<br />
GNOME has the advantage of being very "ready to use" and integrating. You can set up GNOME to use awesome as the visual interface, but have GNOME work in the background for your pleasure. If you are using GNOME 3, you can simply install the [https://aur.archlinux.org/packages.php?ID=53096 awesome-gnome] package, then when logging in with GDM, choose the session type "Awesome GNOME". See the [https://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome awesome wiki] for details.<br />
<br />
===Expose effect like compiz===<br />
<br />
Revelation brings up a view of all your open clients; left-clicking a client pops to the first tag that client is visible on and raises/focuses the client. In addition, the Enter key pops to the currently focused client, and Escape aborts. <br />
<br />
http://awesome.naquadah.org/wiki/Revelation<br />
<br />
===Hide / show wibox in awesome 3===<br />
<br />
To map Modkey-b to hide/show default statusbar on active screen (as default in awesome 2.3), add to your ''globalkeys'' in rc.lua:<br />
<br />
awful.key({ modkey }, "b", function ()<br />
mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible<br />
end),<br />
<br />
===Enable printscreens===<br />
<br />
To enable printscreens in awesome through the PrtScr button you need to have a screen capturing program.<br />
Scrot is a easy to use utility for this purpose and is available in Arch repositories.<br />
<br />
Just type:<br />
# pacman -S scrot<br />
<br />
and install optional dependencies if you feel that you need them.<br />
<br />
Next of we need to get the key name for PrtScr, most often this is named "Print" but one can never be too sure.<br />
<br />
Start up:<br />
# xev<br />
<br />
And press the PrtScr button, the output should be something like:<br />
KeyPress event ....<br />
root 0x25c, subw 0x0, ...<br />
state 0x0, keycode 107 (keysym 0xff61, '''Print'''), same_screen YES,<br />
....<br />
<br />
In my case as you see, the keyname is Print.<br />
<br />
Now to the configuration of awesome!<br />
<br />
Somewhere in your globalkeys array (doesn't matter where) type:<br />
<br />
Lua code:<br />
<br />
awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'") end),<br />
<br />
A good place to put this is bellow the keyhook for spawning a terminal.<br />
To find this line search for: awful.util.spawn(terminal) in your favourite text editor.<br />
<br />
Also, this function saves screenshots inside ~/screenshots/, edit this to fit your needs.<br />
<br />
===Dynamic tagging===<br />
<br />
[http://awesome.naquadah.org/wiki/Eminent Eminent] is a small lua library that monkey-patches awful to provide you with effortless and quick wmii-style dynamic tagging. Unlike shifty, eminent does not aim to provide a comprehensive tagging system, but tries to make dynamic tagging as simple as possible. In fact, besides importing the eminent library, you do not have to change your rc.lua at all, eminent does all the work for you.<br />
<br />
[http://awesome.naquadah.org/wiki/Shifty Shifty] is an Awesome 3 extension that implements dynamic tagging. It also implements fine client matching configuration allowing YOU to be the master of YOUR desktop only by setting two simple config variables and some keybindings!<br />
<br />
===Space Invaders===<br />
[http://awesome.naquadah.org/wiki/Space_Invaders Space Invaders] is a demo to show the possibilities of the Awesome Lua API.<br />
<br />
Please note that it is no longer included in the Awesome package since the 3.4-rc1 release.<br />
<br />
===Naughty for popup notification===<br />
See [https://awesome.naquadah.org/wiki/Naughty the awesome wiki page on naughty].<br />
<br />
===Popup Menus===<br />
There's a simple menu by default in awesome3, and customed menus seem very easy now. However, if you're using 2.x awesome, have a look at ''[http://awesome.naquadah.org/wiki/Awful.menu awful.menu]''.<br />
<br />
An example for awesome3:<br />
{{bc|1=<br />
myawesomemenu = {<br />
{ "lock", "xscreensaver-command -activate" },<br />
{ "manual", terminal .. " -e man awesome" },<br />
{ "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },<br />
{ "restart", awesome.restart },<br />
{ "quit", awesome.quit }<br />
}<br />
<br />
mycommons = {<br />
{ "pidgin", "pidgin" },<br />
{ "OpenOffice", "soffice-dev" },<br />
{ "Graphic", "gimp" }<br />
}<br />
<br />
mymainmenu = awful.menu.new({ items = { <br />
{ "terminal", terminal },<br />
{ "icecat", "icecat" },<br />
{ "Editor", "gvim" },<br />
{ "File Manager", "pcmanfm" },<br />
{ "VirtualBox", "VirtualBox" },<br />
{ "Common App", mycommons, beautiful.awesome_icon },<br />
{ "awesome", myawesomemenu, beautiful.awesome_icon }<br />
}<br />
})<br />
}}<br />
<br />
===More Widgets in awesome===<br />
''Widgets in awesome are objects that you can add to any widget-box (statusbars and titlebars), they can provide various information about your system, and are useful for having access to this information, right from your window manager. Widgets are simple to use and offer a great deal of flexibility.'' -- Source [http://awesome.naquadah.org/wiki/Widgets_in_awesome Awesome Wiki: Widgets].<br />
<br />
There's a widely used widget library called '''Wicked''' (compatible with awesome versions '''prior to 3.4'''), that provides more widgets, like MPD widget, CPU usage, memory usage, etc. For more details see the [http://awesome.naquadah.org/wiki/Wicked Wicked page].<br />
<br />
As a replacement for Wicked in awesome v3.4 check '''[http://awesome.naquadah.org/wiki/Vicious Vicious]''', '''[http://awesome.naquadah.org/wiki/Obvious Obvious]''' and '''[http://awesome.naquadah.org/wiki/Bashets Bashets]'''. If you pick vicious, you should also take a good look at [http://git.sysphere.org/vicious/tree/README vicious documentation].<br />
<br />
===Transparency===<br />
Awesome has support for true transparency through xcompmgr. Note that you'll probably want the git version of xcompmgr, which is [http://aur.archlinux.org/packages.php?ID=16554 available in AUR]. <br />
<br />
Add this to your ~/.xinitrc:<br />
xcompmgr &<br />
See ''man xcompmgr'' or [[xcompmgr]] for more options.<br />
<br />
In awesome 3.4, window transparency can be set dynamically using signals. For example, your rc.lua could contain the following:<br />
<br />
client.add_signal("focus", function(c)<br />
c.border_color = beautiful.border_focus<br />
c.opacity = 1<br />
end)<br />
client.add_signal("unfocus", function(c)<br />
c.border_color = beautiful.border_normal<br />
c.opacity = 0.7<br />
end)<br />
'''If you got error messages about add_signal, using connect_signal insteaded.''' <br />
<br />
Note that if you are using conky, you must set it to create its own window instead of using the desktop. To do so, edit ~/.conkyrc to contain:<br />
<br />
own_window yes<br />
own_window_transparent yes<br />
own_window_type desktop<br />
<br />
Otherwise strange behavior may be observed, such as all windows becoming fully transparent. Note also that since conky will be creating a transparent window on your desktop, any actions defined in awesome's rc.lua for the desktop will not work where conky is.<br />
<br />
As of Awesome 3.1, there is built-in pseudo-transparency for wiboxes. To enable it, append 2 hexadecimal digits to the colors in your theme file (~/.config/awesome/themes/default, which is usually a copy of /usr/share/awesome/themes/default), like shown here:<br />
<br />
bg_normal = #000000AA<br />
<br />
where "AA" is the transparency value.<br />
<br />
To change transparency for the actual selected window by pressing Modkey + PageUp/PageDown you can also use tansset-df available through the community package repository and the following modification to your rc.lua:<br />
<br />
globalkeys = awful.util.table.join(<br />
-- your keybindings<br />
[...]<br />
awful.key({ modkey }, "Next", function (c)<br />
exec("transset-df --actual --inc 0.1")<br />
end),<br />
awful.key({ modkey }, "Prior", function (c)<br />
exec("transset-df --actual --dec 0.1")<br />
end),<br />
-- Your other key bindings<br />
[...]<br />
)<br />
<br />
==== ImageMagick ====<br />
You may have problems if you set your wallpaper with imagemagick's ''display'' command, it doesn't work well with xcompmgr. Please note that awsetbg may be using ''display'' if it doesn't have any other options. Installing habak, feh, hsetroot or whatever should fix the problem (''grep -A 1 wpsetters /usr/bin/awsetbg'' to see your options).<br />
<br />
===Autorun programs===<br />
''See also [https://awesome.naquadah.org/wiki/Autostart the Autostart page on the Awesome wiki].''<br />
<br />
awesome doesn't run programs set to autostart by the Freedesktop specification like GNOME or KDE. However, awesome does provide a few functions for starting programs (in addition to the Lua standard library function {{Ic|os.execute}}). To run the same programs on startup as GNOME or KDE, you can install [http://aur.archlinux.org/packages.php?ID=41099 dex] from the [[AUR]] and then run that in your rc.lua:<br />
<br />
os.execute"dex -a"<br />
<br />
If you just want to set up a list of apps for awesome to launch at startup, you can create a table of all the commands you want to spawn and loop through it:<br />
<br />
do<br />
local cmds = <br />
{ <br />
"swiftfox",<br />
"mutt",<br />
"consonance",<br />
"linux-fetion",<br />
"weechat-curses",<br />
--and so on...<br />
}<br />
<br />
for _,i in pairs(cmds) do<br />
awful.util.spawn(i)<br />
end<br />
end<br />
<br />
(You could also run calls to {{Ic|os.execute}} with commands ending in '{{Ic|&}}', but it's probably a better idea to stick to the proper spawn function.)<br />
<br />
To run a program only if it is not currently running, you can spawn it with a shell command that runs the program only if {{Ic|pgrep}} doesn't find a running process with the same name:<br />
function run_once(prg)<br />
awful.util.spawn_with_shell("pgrep -u $USER -x " .. prg .. " || (" .. prg .. ")")<br />
end<br />
<br />
So, for example, to run {{Ic|parcellite}} only if there is not a {{Ic|parcellite}} process already running:<br />
<br />
run_once("parcellite")<br />
<br />
===Passing content to widgets with awesome-client===<br />
<br />
You can easily send text to an awesome widget. Just create a new widget:<br />
{{bc|<nowiki><br />
mywidget = widget({ type = "textbox", name = "mywidget" })<br />
mywidget.text = "initial text"<br />
</nowiki>}}<br />
To update the text from an external source, use awesome-client:<br />
{{bc|<nowiki> <br />
echo -e 'mywidget.text = "new text"' | awesome-client<br />
</nowiki>}}<br />
Don't forget to add the widget to your wibox.<br />
<br />
===Using a different panel with awesome===<br />
<br />
If you like awesome's lightweightness and functionality but do not like the way its default panel looks, you can install a different panel. Just install xfce4-panel by issuing:<br />
{{bc|<br />
sudo pacman -S xfce4-panel<br />
}}<br />
Of course any other panel will do as well. <br />
Then add it to autorun section of your rc.lua (how to do that is written elsewhere on this wiki). You can also comment out the section which creates wiboxes for each screen (starting from "mywibox[s] = awful.wibox({ position = "top", screen = s })" ) but it isn't necessary. Any way do not forget to check your rc.lua for errors by typing <br />
{{bc|<br />
awesome -k rc.lua<br />
}}<br />
Also you should change your "modkey+R" keybinding, in order to start some other application launcher instead of built in awesome. Xfrun4, bashrun, etc. Check the Application launchers section of [[Openbox_Themes_and_Apps#Application_launchers|Openbox]] article for examples. Don't forget to add<br />
{{bc|<nowiki><br />
properties = { floating = true } },<br />
{ rule = { instance = "$yourapplicationlauncher" },<br />
</nowiki>}}<br />
to your rc.lua.<br />
<br />
===Fix Java (GUI appears gray only)===<br />
Guide taken from [https://bbs.archlinux.org/viewtopic.php?pid=450870].<br />
#Install {{Pkg|wmname}} from community<br />
#Run the following command or add it to your {{ic|.xinitrc}}: {{bc|wmname LG3D}}<br />
<br />
===Prevent Nautilus from displaying the desktop (Gnome3)===<br />
Run dconf-editor. Navigate to org->background and uncheck "draw-background" as well as "show-desktop-icons" for good measure. That's it!<br />
<br />
Another option is moving /usr/bin/nautilus to a new location and replacing it with a script that runs 'nautilus --no-desktop' passing any arguments it receives along.<br />
<br />
#!/bin/sh<br />
/usr/bin/nautilus-real --no-desktop $@<br />
<br />
===Transitioning away from Gnome3===<br />
Run 'gnome-session-properties' and remove programs that you won't be needing anymore (e.g Bluetooth Manager, Login Sounds, etc).<br />
<br />
If you'd like to get rid of GDM, make sure that your rc.conf DAEMONS list includes "dbus" (and "cupsd" if you have a printer). It's advisable to get a different login manager (like [https://wiki.archlinux.org/index.php/SLiM SLiM]), but you can do things manually if you wish. That entails setting up your [https://wiki.archlinux.org/index.php/Udev .xinitrc properly] and installing something like devmon ([http://aur.archlinux.org/packages.php?ID=45842 AUR]).<br />
<br />
If you wan't to keep a few convenient systray applets and your GTK theme, append this to your rc.lua;<br />
function start_daemon(dae)<br />
daeCheck = os.execute("ps -eF | grep -v grep | grep -w " .. dae)<br />
if (daeCheck ~= 0) then<br />
os.execute(dae .. " &")<br />
end<br />
end<br />
<br />
procs = {"gnome-settings-daemon", "nm-applet", "kupfer", "gnome-sound-applet", "gnome-power-manager"}<br />
for k = 1, #procs do<br />
start_daemon(procs[k])<br />
end<br />
<br />
===Prevent the mouse scroll wheel from changing tags===<br />
In your rc.lua, change the Mouse Bindings section to the following;<br />
-- {{{ Mouse bindings<br />
root.buttons(awful.util.table.join(<br />
awful.button({ }, 3, function () mymainmenu:toggle() end)))<br />
-- }}}<br />
<br />
==Troubleshooting==<br />
<br />
===Mod4 key===<br />
<br />
The Mod4 is by default the '''Win key'''. If it's not mapped by default, for some reason, you can check the keycode of your Mod4 key with<br />
<br />
$ xev<br />
<br />
It should be 115 for the left one. Then add this to your ~/.xinitrc<br />
<br />
xmodmap -e "keycode 115 = Super_L" -e "add mod4 = Super_L"<br />
exec awesome<br />
<br />
The problem in this case is that some xorg installations recognize keycode 115, but incorrectly as the 'Select' key. The above command explictly remaps keycode 115 to the correct 'Super_L' key.<br />
<br />
====Mod4 key vs. IBM ThinkPad users====<br />
<br />
IBM ThinkPads do not come equipped with a Window key (although Lenovo have changed this tradition on their ThinkPads). As of writing, the Alt key is not used in command combinations by the default rc.lua (refer to the Awesome wiki for a table of commands), which allows it be used as a replacement for the Super/Mod4/Win key. To do this, edit your rc.lua and replace:<br />
<br />
modkey = "Mod4"<br />
<br />
by:<br />
<br />
modkey = "Mod1"<br />
<br />
Note: Awesome does a have a few commands that make use of Mod4 plus a single letter. Changing Mod4 to Mod1/Alt could cause overlaps for some key combinations. The small amount of instances where this happens can be changed in the rc.lua file.<br />
<br />
If you do not like to change the awesome standards, you might like to remap a key. For instance the caps lock key is rather useless (for me) adding the following contents to ~/.Xmodmap <br />
<br />
clear lock <br />
add mod4 = Caps_Lock<br />
<br />
and [[Extra Keyboard Keys in Xorg#Step 2: Testing|(re)load]] the file.<br />
This will change the caps lock key into the mod4 key and works nicely with the standard awesome settings. In addition, if needed, it provides the mod4 key to other X-programs as well.<br />
<br />
Not confirmed, but if recent updates of xorg related packages break mentioned remapping the second line can be replaced by (tested on a DasKeyboard with no left Super key):<br />
<br />
keysym Caps_Lock = Super_L Caps_Lock<br />
<br />
===Brasero===<br />
If Brasero doesn't detect your blank disks when started in Awesome, but works just fine when started in Gnome, try using<br />
$ dbus-launch brasero<br />
<br />
==External Links==<br />
* http://awesome.naquadah.org/wiki/FAQ - FAQ<br />
* http://www.lua.org/pil/ - Programming in Lua (first edition)<br />
* http://awesome.naquadah.org/ - The official awesome website<br />
* http://awesome.naquadah.org/wiki/Main_Page - the awesome wiki<br />
* http://www.penguinsightings.org/desktop/awesome/ - A review<br />
* http://compsoc.tardis.ed.ac.uk/wiki/AwesomeWM_guide - Awesome guide<br />
* https://bbs.archlinux.org/viewtopic.php?id=88926 - share your awesome!</div>Trishikahttps://wiki.archlinux.org/index.php?title=Samba&diff=162766Samba2011-09-28T10:16:47Z<p>Trishika: Fix intern link</p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|Samba}}<br />
[[fr:Samba]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user stick close to the following directions.<br />
<br />
==Installation==<br />
Installing only the ''client'' program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package (which includes {{codeline|smbclient}}):<br />
# pacman -S samba<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is set up, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
More information about the options available can be found in {{Codeline|man smb.conf}}<br />
<br />
===Managing the samba daemon===<br />
<br />
To automatically start {{codeline|samba}} at boot, add it to the DAEMONS line in {{Filename|[[rc.conf]]}}:<br />
<br />
DAEMONS=(... ... samba ... ...)<br />
<br />
To start/restart/stop the daemon manually, use the following:<br />
<br />
# rc.d {start|stop|restart} samba<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the eXtended InterNET Daemon, [[Wikipedia:xinetd|xinetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. SWAT is a tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -S xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
service swat<br />
{<br />
type = UNLISTED<br />
protocol = tcp<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}<br />
<br />
Alternatively you can add an entry for swat to {{Filename|/etc/services}} and omit the first 3 lines of the configuration.<br />
<br />
Then start xinetd daemon:<br />
<br />
# rc.d start xinetd<br />
<br />
The web interface can be accessed on port 901 by default:<br />
http://localhost:901/<br />
<br />
===Adding users===<br />
To log into a Samba share you will need to add a user.<br />
<br />
For Samba versions 3.4.0 and above:<br />
# pdbedit -a -u <user><br />
<br />
For earlier versions of Samba:<br />
# smbpasswd -a <user><br />
<br />
Existing smbpasswd databases can also be [[Samba#Changes_in_Samba_version_3.4.0|converted to the new format]].<br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
{{Note|smbpasswd is no longer used by default as of [[Samba#Changes_in_Samba_version_3.4.0|Samba version 3.4.0]] }}<br />
<br />
==Accessing shares==<br />
Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods The graphical manner is limited. Some Desktop Environments have a way to facilitate accessing these shared resources. However, most do not. In fact, most lightweight DE's and WM's offer no native method.<br />
<br />
There are two parts to share access. First is the underlying file system mechanism, and second is the interface which allows the user to select to mount shared resources. Some environments have the first part built into them.<br />
<br />
If you are using KDE, it has the ability to browse Samba shares. You therefore do not need any additional packages. (However, for a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra]. Another program choice is SMB4K.) If, however, you plan to use the share in Gnome or solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome/Xfce4===<br />
In order to access samba shares through Nautilus, first install the gvfs-smb and gnome-vfs packages:<br />
# pacman -S gvfs-smb gnome-vfs<br />
<br />
For access under Xfce4 using thunar, one only needs gvfs-smb<br />
# pacman -S gvfs-smb<br />
<br />
From a Nautilus/Thunar window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow for the typing in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If the servername is not in {{Filename|/etc/hosts}}, use the IP Address of the server in place of the servername.}}<br />
<br />
Another Gnome browser program is Gnomba.<br />
<br />
If iptables is running, the '''nf_conntrack_netbios_ns''' module should be loaded:<br />
modprobe nf_conntrack_netbios_ns<br />
<br />
===Accessing shares from other graphical environments===<br />
There are a number of useful programs, but they will need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.<br />
<br />
LinNeighborhood is non-specific when it comes to the DE or WM. It can be seen as a simple and generic X-based LAN browser and share mounter. Not pretty, but effective.<br />
<br />
Other possible programs include pyneighborhood and RUmba, as well as the xffm-samba plugin for Xffm.<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
If the required configuration is properly researched and done, it is claimed that all shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
If a username and a password are required to access some of the shared folders, you have to edit {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} by uncommenting the line starting with "auth" and editing it to your needs:<br />
<br />
auth "hostname" "username" "password"<br />
<br />
Then, it may be necessary to change the permissions of {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} and all include files for smbnetfs to work correctly:<br />
<br />
# chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]].<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong as the mount point resides in a directory ''controllable'' by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[#smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
==== Option 1 - Force guest connections ====<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
==== Option 2 - Allow guest and User connections ====<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and add the following line:<br />
<br />
map to guest = Bad User<br />
<br />
After this line<br />
<br />
security = user<br />
<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make<br />
; sure the user here is the same as the user of the folder you<br />
; want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Adding network shares using KDE4 GUI ===<br />
How to configure the folder sharing in KDE4. Simple file sharing limits user shared folders to their home directory and read-only access. Advanced file sharing gives full semantics of Samba with no limits to shared folders but requires su or sudo root permissions.<br />
* Read only, simple file sharing: [[Samba/Simple file sharing with KDE4]]<br />
* Full capability file sharing: [[Samba/Advanced file sharing with KDE4]]<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -p 139 -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range and port 139 has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing shares]]<br />
<br />
=== Remote control of Windows computer ===<br />
<br />
Samba offers a set of tools for communication with Windows. These can be handy in case you cannot access a Windows computer through remote desktop, as shown by some examples.<br />
<br />
Send shutdown command with a comment:<br />
<br />
$ net rpc shutdown -C "comment" -I IPADDRESS -U USERNAME%PASSWORD<br />
If you prefer a forced shutdown instead change -C with comment to a single -f. For a restart you only add -r, followed by a -C or -f.<br />
<br />
Stop and start services:<br />
<br />
$ net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD<br />
<br />
To see all possible net rpc command:<br />
<br />
$ net rpc<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
Note that you have to add this to your '''local''' smb.conf, not to the server's smb.conf<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I do not have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
=== I need to restart samba in order get my shares visible by other ===<br />
<br />
If upon starting your computer, the samba shares you have defined cannot be accessed from any client, check the following :<br />
* Make sure that you have not forgotten to add the samba daemon to the DAEMONS array of /etc/rc.conf (after the 'network' daemon)<br />
* The ''network'' service is not started in the background (prefixed with @ ). Removing the '@' in front of 'network' can fix the issue. Reboot to check.<br />
<br />
My guess on what has happened: When samba starts, the network is not properly initialized, so the server does not know on which interface to listen and thus fails to initialize correctly.<br />
<br />
== Resources ==<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Trishikahttps://wiki.archlinux.org/index.php?title=Installation_Chroot&diff=150614Installation Chroot2011-08-03T21:44:00Z<p>Trishika: </p>
<hr />
<div>[[Category:Installation (English)]]<br />
{{i18n|Installation an ArchLinux system from a chroot}}<br />
<br />
<br />
This article will detail the installation of Arch Linux from an other GNU/Linux (kernel >= 2.6.27) with a chroot.<br />
<br />
This article was originally publish in the [http://wiki.archlinux.fr/Install_chroot ArchLinux.fr wiki]. <br />
A script doing all the step describe in this page is available : [http://calimeroteknik.free.fr/arch-guide/install-chroot.sh install-chroot.sh] <br /><br />
It is indeed advice to read the article.<br />
<br />
== Requirement ==<br />
<br />
To install ArchLinux you need some data :<br />
<br />
{| class="wikitable"<br />
!Variable<br />
!Description<br />
!Example<br />
|-<br />
|install_path<br />
|You have to mount in this directory all the partition that will be part of your system<br />
|/mnt/newarch<br />
|-<br />
|arch<br />
|Architecture of the system: (we can only install i686 from a i686 system)<br />
|i686 or x86_64<br />
|-<br />
|mirror<br />
|Miror of download: the list is available [http://archlinux.org/download/ here]<br />
|http://mir.archlinux.fr<br />
|- <br />
|pacman_mirrorlist_ver<br />
|Actual version of '''pacman-mirrorlist''', see [http://www.archlinux.org/packages/pacman-mirrorlist here].<br />
|20110703-1<br />
|}<br />
<br /><br />
You also need a minimal '''chroot'''. You can find an archive matching your achitecture [http://mir.archlinux.fr/~tuxce/chroot/ here].<br /><br />
<br />
You can export variable with this command, for example :<br />
export install_path="/mnt/newarch"<br />
<br />
{{warning|This method works only to install a system with the same architecture as the host system or to install a 32 bits system with a 64 bits host system.}}<br />
<br />
Before we begin, we will crete the {{filename|tmp}} directory in the new architecture in order to put it temporary files. In {{codeline|$install_path}}:<br />
mkdir tmp<br />
chmod 1777 tmp<br />
<br />
== Base system creation ==<br />
<br />
We need to download the archive and the package {{filename|pacman-mirrorlist}}:<br />
cd "$install_path"/tmp<br />
wget "$mirror/core/os/$arch/pacman-mirrorlist-$pacman_mirrorlist_ver-any.pkg.tar.gz"<br />
wget "http://mir.archlinux.fr/~tuxce/chroot/archlinux.chroot.$arch.tgz"<br />
cd ..<br />
tar zxvf tmp/pacman-mirrorlist-$pacman_mirrorlist_ver-any.pkg.tar.gz<br />
tar zxvf tmp/archlinux.chroot.$arch.tgz<br />
<br />
The mirror configuration file ({{filename|etc/pacman.d/mirrorlist}}) have all its lines commented, you have to uncomment at least one line, for example :<br />
Server = http://mir.archlinux.fr/$repo/os/$arch<br />
<br />
== Chroot preparation ==<br />
<br />
=== The network ===<br />
<br />
In order to have dns resolution, copy your {{Codeline|/etc/resolv.conf}} from the host system to the chroot :<br />
cp /etc/resolv.conf etc/resolv.conf<br />
<br />
=== Mount special file ===<br />
<br />
We need to mount the special file system {{filename|/dev}}, {{filename|/proc}} and {{filename|/sys}} :<br />
mount -o bind /proc "$install_path"/proc<br />
mount -o bind /dev "$install_path"/dev<br />
mount -o bind /sys "$install_path"/sys<br />
<br />
=== Register the mount partitions ===<br />
<br />
Mount partition are list in {{filename|/etc/mtab}}, we need to copy it contents :<br />
grep -v rootfs /proc/mounts > etc/mtab<br />
<br />
=== In the chroot ===<br />
<br />
The ''chroot'' is ready, enter it :<br />
chroot "$install_path" /bin/bash<br />
<br />
== Base system installation ==<br />
<br />
pacman -Syf base<br />
<br />
== Configure the new system ==<br />
<br />
<br />
=== Configure /etc/rc.conf ===<br />
<br />
One of the central file in the ArchLinux system. You'll find everything you need [[rc.conf|here]].<br />
<br />
=== Configure partitions ===<br />
<br />
You have to fill the {{filename|/etc/fstab}}. This file list the partition that will be use by your new system. Your file must look like this :<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
devpts /dev/pts devpts defaults 0 0<br />
shm /dev/shm tmpfs nodev,nosuid 0 0<br />
<br />
/dev/sda5 swap swap defaults 0 0<br />
/dev/sda6 / ext4 defaults 0 1<br />
/dev/sda7 /home ext4 defaults 0 2<br />
<br />
Be carefull to check the existenve of the mount point.<br />
Additionnal information can be found [[fstab|here]]<br />
<br />
=== Grub ===<br />
<br />
Perhaps you'll need [[GRUB]] now. You'll find information [[grub|here]]<br />
<br />
=== Users ===<br />
<br />
==== Root password ====<br />
<br />
The root password is empty by default, you may want to set one :<br />
passwd root<br />
<br />
==== Main user ====<br />
<br />
A basic configuration is :<br />
<br />
useradd -G wheel,audio,optical,storage,video,power -m nom_utilisateur<br />
passwd nom_utilisateur<br />
<br />
You'll find more information [[Groups|here]]<br />
<br />
==== sudo configuration ====<br />
<br />
See [[sudo|here]].</div>Trishikahttps://wiki.archlinux.org/index.php?title=ArchLinux_Installation_with_Chroot&diff=150613ArchLinux Installation with Chroot2011-08-03T21:43:39Z<p>Trishika: moved ArchLinux Installation with Chroot to Installation Chroot over redirect: revert</p>
<hr />
<div>#REDIRECT [[Installation Chroot]]</div>Trishikahttps://wiki.archlinux.org/index.php?title=Installation_Chroot&diff=150612Installation Chroot2011-08-03T21:43:39Z<p>Trishika: moved ArchLinux Installation with Chroot to Installation Chroot over redirect: revert</p>
<hr />
<div></div>Trishikahttps://wiki.archlinux.org/index.php?title=Installation_Chroot&diff=150611Installation Chroot2011-08-03T21:40:42Z<p>Trishika: Blanked the page</p>
<hr />
<div></div>Trishikahttps://wiki.archlinux.org/index.php?title=Installation_Chroot&diff=150609Installation Chroot2011-08-03T21:39:28Z<p>Trishika: moved Installation Chroot to ArchLinux Installation with Chroot: More explicit title</p>
<hr />
<div>#REDIRECT [[ArchLinix Installation with Chroot]]</div>Trishikahttps://wiki.archlinux.org/index.php?title=Installation_Chroot&diff=150608Installation Chroot2011-08-03T21:39:08Z<p>Trishika: moved Installation Chroot to ArchLinix Installation with Chroot: More explicit title</p>
<hr />
<div>#REDIRECT [[ArchLinix Installation with Chroot]]</div>Trishikahttps://wiki.archlinux.org/index.php?title=Samba&diff=139135Samba2011-05-01T15:22:22Z<p>Trishika: add the ip adress option for the fstab</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Samba}}<br />
[[fr:Samba]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user stick close to the following directions.<br />
<br />
==Installation==<br />
Installing only the ''client'' program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package (which will also install the smbclient):<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet it can also use [[Gamin]], as Gamin has almost completely replaced FAM recently, mainly because FAM is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
More information about the options available can be found in {{Codeline|man smb.conf}}<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the eXtended InterNET Daemon, [[Wikipedia:xinetd|xinetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. SWAT is a tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -S xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
service swat<br />
{<br />
type = UNLISTED<br />
protocol = tcp<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}<br />
<br />
Alternatively you can add an entry for swat to {{Filename|/etc/services}} and omit the first 3 lines of the configuration. If xinetd was compiled with tcp_wrappers support (as is the default in Arch), edit {{Filename|/etc/hosts.allow}} by adding following line:<br />
<br />
swat:127.0.0.1<br />
<br />
Then start xinetd daemon:<br />
<br />
# /etc/rc.d/xinetd start<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user.<br />
<br />
For Samba versions 3.4.0 and above:<br />
# pdbedit -a -u <user><br />
<br />
For earlier versions of Samba:<br />
# smbpasswd -a <user><br />
<br />
Existing smbpasswd databases can also be [[Samba#Changes_in_Samba_version_3.4.0|converted to the new format]].<br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
{{Note|smbpasswd is no longer used by default as of [[Samba#Changes_in_Samba_version_3.4.0|Samba version 3.4.0]] }}<br />
<br />
==Accessing shares==<br />
Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods The graphical manner is limited. Some Desktop Environments have a way to facilitate accessing these shared resources. However, most do not. In fact, most lightweight DE's and WM's offer no native method.<br />
<br />
There are two parts to share access. First is the underlying file system mechanism, and second is the interface which allows the user to select to mount shared resources. Some environments have the first part built into them.<br />
<br />
If you are using KDE, it has the ability to browse Samba shares. You therefore do not need any additional packages. (However, for a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra]. Another program choice is SMB4K.) If, however, you plan to use the share in Gnome or solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome===<br />
For Gnome, there is Nautilus. In order to access samba shares thru Nautilus, you must first install the gvfs-smb package<br />
<br />
# pacman -S gvfs-smb<br />
<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
Another Gnome browser program is Gnomba.<br />
<br />
If you have iptables running on your linux box, you need to have the nf_conntrack_netbios_ns module loaded:<br />
modprobe nf_conntrack_netbios_ns<br />
<br />
===Accessing shares from other graphical environments===<br />
There are a number of useful programs, but they will need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.<br />
<br />
LinNeighborhood is non-specific when it comes to the DE or WM. It can be seen as a simple and generic X-based LAN browser and share mounter. Not pretty, but effective.<br />
<br />
Other possible programs include pyneighborhood and RUmba, as well as the xffm-samba plugin for Xffm.<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
If the required configuration is properly researched and done, it is claimed that all shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
If a username and a password are required to access some of the shared folders, you have to edit {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} by uncommenting the line starting with "auth" and editing it to your needs:<br />
<br />
auth "hostname" "username" "password"<br />
<br />
Then, it may be necessary to change the permissions of {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} and all include files for smbnetfs to work correctly:<br />
<br />
# chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]].<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong as the mount point resides in a directory ''controllable'' by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[#smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
==== Option 1 - Force guest connections ====<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
==== Option 2 - Allow guest and User connections ====<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and add the following line:<br />
<br />
map to guest = Bad User<br />
<br />
After this line<br />
<br />
security = user<br />
<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make<br />
; sure the user here is the same as the user of the folder you<br />
; want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Adding network shares using KDE4 GUI ===<br />
How to configure the folder sharing in KDE4. Simple file sharing limits user shared folders to their home directory and read-only access. Advanced file sharing gives full semantics of Samba with no limits to shared folders but requires su or sudo root permissions.<br />
* Read only, simple file sharing: [[Samba/Simple file sharing with KDE4]]<br />
* Full capability file sharing: [[Samba/Advanced file sharing with KDE4]]<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -p 139 -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range and port 139 has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
=== Remote control of Windows computer ===<br />
<br />
Samba offers a set of tools for communication with Windows. These can be handy in case you can't access a Windows computer through remote desktop, as shown by some examples.<br />
<br />
Send shutdown command with a comment:<br />
<br />
$ net rpc shutdown -C "comment" -I IPADDRESS -U USERNAME%PASSWORD<br />
If you prefer a forced shutdown instead change -C with comment to a single -f. For a restart you only add -r, followed by a -C or -f.<br />
<br />
Stop and start services:<br />
<br />
$ net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD<br />
<br />
To see all possible net rpc command:<br />
<br />
$ net rpc<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
Note that you have to add this to your '''local''' smb.conf, not to the server's smb.conf<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
=== I need to restart samba in order get my shares visible by other ===<br />
<br />
If upon starting your computer, the samba shares you have defined cannot be accessed from any client, check the following :<br />
* Make sure that you have not forgotten to add the samba daemon to the DAEMONS array of /etc/rc.conf (after the 'network' daemon)<br />
* The ''network'' service is not started in the background (prefixed with @ ). Removing the '@' in front of 'network' can fix the issue. Reboot to check.<br />
<br />
My guess on what has happened: When samba starts, the network isn't properly initialized, so the server does not know on which interface to listen and thus fails to initialize correctly.<br />
<br />
== Resources ==<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Trishikahttps://wiki.archlinux.org/index.php?title=Samba&diff=139134Samba2011-05-01T15:21:21Z<p>Trishika: add the ip adress option for the fstab</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Samba}}<br />
[[fr:Samba]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user stick close to the following directions.<br />
<br />
==Installation==<br />
Installing only the ''client'' program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package (which will also install the smbclient):<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet it can also use [[Gamin]], as Gamin has almost completely replaced FAM recently, mainly because FAM is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
More information about the options available can be found in {{Codeline|man smb.conf}}<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the eXtended InterNET Daemon, [[Wikipedia:xinetd|xinetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. SWAT is a tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html]<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -S xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
service swat<br />
{<br />
type = UNLISTED<br />
protocol = tcp<br />
port = 901<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/swat<br />
log_on_success += HOST DURATION<br />
log_on_failure += HOST<br />
disable = no<br />
}<br />
<br />
Alternatively you can add an entry for swat to {{Filename|/etc/services}} and omit the first 3 lines of the configuration. If xinetd was compiled with tcp_wrappers support (as is the default in Arch), edit {{Filename|/etc/hosts.allow}} by adding following line:<br />
<br />
swat:127.0.0.1<br />
<br />
Then start xinetd daemon:<br />
<br />
# /etc/rc.d/xinetd start<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user.<br />
<br />
For Samba versions 3.4.0 and above:<br />
# pdbedit -a -u <user><br />
<br />
For earlier versions of Samba:<br />
# smbpasswd -a <user><br />
<br />
Existing smbpasswd databases can also be [[Samba#Changes_in_Samba_version_3.4.0|converted to the new format]].<br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
{{Note|smbpasswd is no longer used by default as of [[Samba#Changes_in_Samba_version_3.4.0|Samba version 3.4.0]] }}<br />
<br />
==Accessing shares==<br />
Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods The graphical manner is limited. Some Desktop Environments have a way to facilitate accessing these shared resources. However, most do not. In fact, most lightweight DE's and WM's offer no native method.<br />
<br />
There are two parts to share access. First is the underlying file system mechanism, and second is the interface which allows the user to select to mount shared resources. Some environments have the first part built into them.<br />
<br />
If you are using KDE, it has the ability to browse Samba shares. You therefore do not need any additional packages. (However, for a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra]. Another program choice is SMB4K.) If, however, you plan to use the share in Gnome or solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome===<br />
For Gnome, there is Nautilus. In order to access samba shares thru Nautilus, you must first install the gvfs-smb package<br />
<br />
# pacman -S gvfs-smb<br />
<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
Another Gnome browser program is Gnomba.<br />
<br />
If you have iptables running on your linux box, you need to have the nf_conntrack_netbios_ns module loaded:<br />
modprobe nf_conntrack_netbios_ns<br />
<br />
===Accessing shares from other graphical environments===<br />
There are a number of useful programs, but they will need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.<br />
<br />
LinNeighborhood is non-specific when it comes to the DE or WM. It can be seen as a simple and generic X-based LAN browser and share mounter. Not pretty, but effective.<br />
<br />
Other possible programs include pyneighborhood and RUmba, as well as the xffm-samba plugin for Xffm.<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
If the required configuration is properly researched and done, it is claimed that all shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
If a username and a password are required to access some of the shared folders, you have to edit {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} by uncommenting the line starting with "auth" and editing it to your needs:<br />
<br />
auth "hostname" "username" "password"<br />
<br />
Then, it may be necessary to change the permissions of {{filename|/etc/smbnetfs/.smb/smbnetfs.conf}} and all include files for smbnetfs to work correctly:<br />
<br />
# chmod 600 /etc/smbnetfs/.smb/smbnetfs.conf<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]].<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP,ip=SERVERIP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong as the mount point resides in a directory ''controllable'' by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[#smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
==== Option 1 - Force guest connections ====<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
==== Option 2 - Allow guest and User connections ====<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and add the following line:<br />
<br />
map to guest = Bad User<br />
<br />
After this line<br />
<br />
security = user<br />
<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make<br />
; sure the user here is the same as the user of the folder you<br />
; want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Adding network shares using KDE4 GUI ===<br />
How to configure the folder sharing in KDE4. Simple file sharing limits user shared folders to their home directory and read-only access. Advanced file sharing gives full semantics of Samba with no limits to shared folders but requires su or sudo root permissions.<br />
* Read only, simple file sharing: [[Samba/Simple file sharing with KDE4]]<br />
* Full capability file sharing: [[Samba/Advanced file sharing with KDE4]]<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -p 139 -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range and port 139 has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
=== Remote control of Windows computer ===<br />
<br />
Samba offers a set of tools for communication with Windows. These can be handy in case you can't access a Windows computer through remote desktop, as shown by some examples.<br />
<br />
Send shutdown command with a comment:<br />
<br />
$ net rpc shutdown -C "comment" -I IPADDRESS -U USERNAME%PASSWORD<br />
If you prefer a forced shutdown instead change -C with comment to a single -f. For a restart you only add -r, followed by a -C or -f.<br />
<br />
Stop and start services:<br />
<br />
$ net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD<br />
<br />
To see all possible net rpc command:<br />
<br />
$ net rpc<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
Note that you have to add this to your '''local''' smb.conf, not to the server's smb.conf<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
=== I need to restart samba in order get my shares visible by other ===<br />
<br />
If upon starting your computer, the samba shares you have defined cannot be accessed from any client, check the following :<br />
* Make sure that you have not forgotten to add the samba daemon to the DAEMONS array of /etc/rc.conf (after the 'network' daemon)<br />
* The ''network'' service is not started in the background (prefixed with @ ). Removing the '@' in front of 'network' can fix the issue. Reboot to check.<br />
<br />
My guess on what has happened: When samba starts, the network isn't properly initialized, so the server does not know on which interface to listen and thus fails to initialize correctly.<br />
<br />
== Resources ==<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Trishika