• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. dvlsg
    3. Posts
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 101
    • Groups 0

    Posts

    Recent Best Controversial
    • MySQL command line from Debug Mode

      So I’m not sure this is a “problem”, per se, but it’s something I’ve been trying to get working that’s giving me a problem.

      I would like to have access to running a MySQL command line query from Debug Mode. I’ve been fiddling a bit with mounting the init.gz, expanding it, and trying to copy over some of the MySQL files to the same locations in the expanded init (/usr/bin/mysql on the host to /usr/bin/mysql on the expanded init). This is in the correct location on Debug Mode, but when I try running mysql, I receive this error: “/bin/sh: mysql: not found”. Launching #!/usr/bin/mysql seems to technically run, but doesn’t return anything (not even an error). I’m starting to wonder if I didn’t include all of the necessary files.

      So I guess my question is this - how would “install” MySQL into the init.gz (or any command, for that matter - like whereis) so I can run it from Debug Mode?

      posted in FOG Problems
      D
      dvlsg
    • RE: Hostname Change & Joining Domain Before Sysprep Runs (XP & Win7!)

      Phew. You’re right, you worked hard on this, haha.

      I’ll see what I can do about finding time to look into it. It may be a while - I’m going to be out of town for a bit after today. But I’ll check back in when I get time.

      posted in General
      D
      dvlsg
    • RE: FOG HostnameChanger and Sysprep

      [quote=“Lee Rowlett, post: 7960, member: 28”]i actually have a solution for this, i’ve written code so that once fog has deployed the image to the machine it will change sysprep.inf for xp and unattend.xml to the hostname in the fog database and will add ad information from fog if set to join AD so when sysprep runs it already matches what has been set in FOG, this would solve all this but i don’t think the developers will go for it as it renders hostname change early un-needed and these features in FOGClient are no longer needed. if you want info on how to do this pm me as it’d be a lengthy tutorial/set of instructions to write. if a few people find it easy to implement then i’ll post an how to when i have the time to sit down and write one up…[/quote]

      Haha, I would like to see that, actually. Although - if you’d like to keep it short and simple, could you tell me exactly where (and as a result, when) the code is being executed to open and alter unattend.xml? Are you running a MySQL query from the computer being imaged to grab the computer name? I could probably figure it out from there.

      I actually had a system in place which would actually open up and edit the unattend file mid sysprep, by adding this registry key right before restarting, but after sysprepping -
      “reg add HKLM\System\Setup /v CmdLine /t REG_SZ /d “cmd /c cscript //nologo C:\windows\system32\sysprep\editunattend.vbs” /f”

      Editunattend.vbs would essentially open up c:\Windows\Panther\unattend.xml, expand the environment variable for %COMPUTERNAME% that was in place, look for a string called “REPLACEME” in the unnattend file, and swap the strings and resave the file. Then it would kick off %WINDIR%\System32\oobe\windeploy.exe and sysprep would continue like normal.

      Never got it to work though – it would work when there was a msgbox asking for the computer name as an input, so I’m thinking the %COMPUTERNAME% variable is either blank or unavailable when it tries running. Which is a shame.

      posted in Windows Problems
      D
      dvlsg
    • RE: Ntfs resize error - image upload - Acer Veriton 7600GT

      Can you boot the computer into debug mode from FOG, run an fdisk -l, and then report the results here?

      posted in FOG Problems
      D
      dvlsg
    • RE: Fog and Uploading VMWare VM Image

      Yeah, I’ve technically got my kernel edited to include the SCSI drivers, but I agree - it would’ve been easier to just switch to IDE before loading the OS.

      posted in FOG Problems
      D
      dvlsg
    • RE: Custom MySQL Reports

      Man I hate batch script some days. I actually got it working with my .bat file.

      I had to use set vmvar=VMWare%% (double for the escape)
      and then use SELECT * FROM inventory WHERE iSysman NOT LIKE ‘%vmvar%’;

      Batch must’ve been trying to do something with the % originally, but once I had it placed in a variable it knew not to touch it. What a headache. >_<

      Thanks for the help! I’ll have to look into php sometime when I’m not on a bit of a time crunch.

      posted in FOG Problems
      D
      dvlsg
    • RE: Custom MySQL Reports

      Also, I currently have a view set up in MySQL that is essentially just SELECT * FROM inventory WHERE iSysman NOT LIKE ‘%VMWare%’;

      Maybe I’ll just run with that. Seems a bit silly to have an extra view for something like that, though, haha.

      posted in FOG Problems
      D
      dvlsg
    • RE: Custom MySQL Reports

      Yeah… vbs never makes me happy. I enjoy how much it’s capable of (some days), but some of the steps required to get there are… confusing, to say the least.

      php is something I don’t know anything about. I typically go to VBS or BAT because I know all of our Windows machines will be able to run the scripts without any extra installations. Is php executable without any extra compiling/standard on all versions of Windows?

      posted in FOG Problems
      D
      dvlsg
    • RE: Detected file system: Raw

      I’ve got a working set of steps for Windows 7 in VMWare as of just a few days ago. I’ll work on updating the wiki when I get a chance (first I’ll have to figure out how to edit a wiki… haha)

      posted in FOG Problems
      D
      dvlsg
    • RE: Custom MySQL Reports

      It must be, some way or another. Running the exact same line of code by typing it out in cmd, and executing it as a batch file (both with and without escape characters for the %) returns different results. The expected results come from typing it out, and the incorrect results come from executing it in a batch file.

      Time to move over to vbs, I think.

      posted in FOG Problems
      D
      dvlsg
    • RE: Custom MySQL Reports

      Oh apologies - the quotes are from a windows batch script, and mysql.exe and sed.exe are being stored on a network path with spaces in it. I cut the network path out since it’s long and not really relevant. I missed deleting those quotes when pasting the information in the forums.

      Running SELECT COUNT(*) FROM inventory WHERE iSysman LIKE ‘%VMWare%’; returns a count of 2 (which is correct - I have a Windows 7 Professional and Enterprise VM in the database). Using NOT LIKE also returns the correct count.

      I think the SQL statement itself is working. If I run the query in a cmd window, I can scroll up and verify that the VMs are not included – which just confuses the hell out of me, because I don’t know why or how sed is pulling the information about the VM, since it’s not being ouput by the SQL query. I know I’m not just accidentally looking at a saved CSV file either, since I’m deleting the old CSV before creating a new one each time.

      I wonder if the batch file is getting thrown off by the %.

      posted in FOG Problems
      D
      dvlsg
    • Custom MySQL Reports

      Apologies if I’m not using the right terminology – I’m currently working on setting up some custom reporting, since I’m looking into adding information about serial keys into a new table into FOG.

      However, I’m getting stuck at my first step - I want to create a csv file that excludes my VMs, and be able to update that file remotely. I have remote access and querying working properly, but something goes wrong with sed to convert the mysql output into a csv. Here’s my code:

      mysql.exe" -h192.168.4.132 -ufog-remote-mysql -pPASSWORD -Dfog -B -e “SELECT * FROM inventory WHERE iSysman NOT LIKE ‘VMware%’;” | sed s/\t/“,”/g;s/^/“/;s/$/”/;s/\n//g > fog_mysql_licenses.csv"

      Running the “SELECT * FROM inventory WHERE iSysman NOT LIKE ‘VMware%’;” returns the correct output (all of my machines that aren’t VMs) – both locally on the FOG server with a direct connection to mysql, and using mysql.exe on my windows machine. However, using sed to convert the output into a csv always includes my VMs.

      If anyone has any insight, I would love to hear it, because I am all kinds of stumped.

      posted in FOG Problems
      D
      dvlsg
    • RE: Getting to ZEN Works - The Challenge

      I would assume bundling software is just ZEN Works’s fancy way of saying “install software post-image”.
      If this is true, FOG would be able to accomplish this through snapins (you could even do it with batch, vbscript, and csv files on network storage if you really wanted to - that’s how my company does it right now).

      As for point 5, I’m guessing they are talking about mounting and editing the image being stored on the server. Doing that… I’m not so sure. It looks like this forum has some insight into it:
      [url]http://www.linuxquestions.org/questions/linux-general-1/how-to-mount-img-file-882386/[/url]
      (I believe FOG stores images as the .img file type? Or possibly .img.000, but I’m not sure how or if it differs)

      I would love to hear some steps about how you got the software inventory into the fog interface, if you have the time to help out. I’m looking into doing that myself, but I know nothing about php, and a limited amount about sql.

      posted in General
      D
      dvlsg
    • RE: Fog and Uploading VMWare VM Image

      Got Single Partition (resizable) working for my new image.

      The important difference between the two images: The new image was created [I]without[/I] using VMWare’s “Easy Install”. I ran through the Windows installation by hand, manually removed all the partitions, and allowed Windows to create that extra 100 MB partition. With that in place, FOG recognizes and handles Windows 7 as a single, resizable partition.

      I also created the VM, deleted the SCSI drive, and added in an IDE drive before installing Windows on it, but I don’t think that has anything to do with this issue.

      posted in FOG Problems
      D
      dvlsg
    • RE: How to: Make a simple snapin-Start to finish

      Thanks for sharing! The stuff with 7zip and SFX maker is definitely helpful.

      Another thought to add about determining whether or not a computer is running 64 or 32bit, I’ve used these lines (in batch script):

      IF %processor_architecture% == x86 (for 32 bit)
      IF %processor_architecture% == AMD64 (for 64 bit clients)
      IF %processor_architecture% == IA64 (for 64 bit servers)

      I doubt many people (if any) would ever feel the need to change the Program Files environment variable, though, so I’m sure your check works great too!

      posted in Tutorials
      D
      dvlsg
    • RE: How to use FOG to supply machine specific drivers for Windows 7 Sysprepped machines

      I’ve done that quite a few times myself, actually, haha. I’m still not sure what exactly determines whether or not the end of a line requires a semicolon in linux scripting.

      posted in General
      D
      dvlsg
    • RE: How to use FOG to supply machine specific drivers for Windows 7 Sysprepped machines

      Ahhh okay. Good! I’m glad you got it all worked out. Sorry I couldn’t have been more help, haha.

      posted in General
      D
      dvlsg
    • RE: How to use FOG to supply machine specific drivers for Windows 7 Sysprepped machines

      Hmm… Here’s something else I noticed (probably should’ve noticed this earlier… it’s been a long Monday already – trying to do a lot of IT work with some FOG stuff on the side):

      cp -r /images/Drivers/WinXP/[B]“[/B]{$machine}[B]”[/B]/* /ntfs/WINDOWS/TestDrivers;

      I noticed that you sometimes have quotes around {$machine} in your code, but in the code I got to work, the quotes went around the whole directory, like this:

      cp -r [B]“[/B]/images/Drivers/WinXP/{$machine}/*[B]”[/B] /ntfs/WINDOWS/TestDrivers;

      Maybe that’s the cause of the problem, if they’re still there?

      posted in General
      D
      dvlsg
    • RE: How to use FOG to supply machine specific drivers for Windows 7 Sysprepped machines

      Ah. I think I have it figured out – one more check quick, just to verify (I’ll get back to you as soon as I get a chance).

      [I]Edit:[/I] Sort of good to go on my end… It actually ends up creating a file named “machinetest” instead of a folder. Maybe I didn’t have my file structure quite right on the server. Maybe someone else has more insight. But it seems to be finding $machine, since it’s not erroring out and saying the “Latitude E6510” folder doesn’t exist. Here’s all the relevant code:

      Note: I don’t know much about links, but I believe the bolded part of the code below is important: my suggestion would be try to copy it that way if you haven’t already.

      Other notes: Testing with a Latitude E6510, relevant folder on the FOG server is /images/Latitude E6510. Permissions are 777 and root:root. c:\machinetest does [I]not[/I] exist on the test computer, but is created through this script. /root/mydrivers also does [I]not[/I] exist pre-function, but is a

      [FONT=Calibri] machine=dmidecode -s system-product-name;[/FONT]
      [FONT=Calibri] machine=“${machine%”${machine##[![:space:]]}“}” #Remove trailing spaces[/FONT]
      [FONT=Calibri] echo " “;[/FONT]
      [FONT=Calibri] echo " * FOG Scripts Copy for $machine”;[/FONT]
      [FONT=Calibri] echo " ";[/FONT]
      [FONT=Calibri] mkdir /ntfs &>/dev/null[/FONT]
      [FONT=Calibri] if [ “$osid” = “5” ][/FONT]
      [FONT=Calibri] then[/FONT]
      [FONT=Calibri] ntfs-3g -o force,rw $win7sys /ntfs[/FONT]
      [FONT=Calibri] elif [ “$osid” = “1” ][/FONT]
      [FONT=Calibri] then[/FONT]
      [FONT=Calibri] ntfs-3g -o force,rw $part /ntfs[/FONT]
      [FONT=Calibri] fi[/FONT]
      [FONT=Calibri] [B]ln -s “/images/${machine}/” /root/mydrivers[/B][/FONT]
      [FONT=Calibri] cp -r /root/mydrivers/
      /ntfs/machinetest[/FONT]

      [I]Edit #2: [/I]Ah. The only file I had in /images/Latitude E6510 was a file called test.txt that only said “TEST”. I opened c:\machinetest with a text editor and it said “TEST”. FOG must’ve copied the test.txt over and converted it to machinetest. I’m guessing if I had a legitimate folder structure/set of files in my drivers location it would’ve worked fine.

      posted in General
      D
      dvlsg
    • 1 / 1