Page 1 of 1
[Solved] Issue with encoding and shared folders
Posted: 18. Jul 2009, 09:28
by Lobe
Hey,
I currently have virtualbox set up to run a LAMP web server on Ubuntu 9.04 as the guest OS. The webserver root shares a folder (through VB's shared folder feature) with the host (Windows XP) so that all changes are instant and do not require a file transfer. The problem is that in javascript files, revisions are showing up weirdly in browsers. The initial load is fine, however any revisions will either truncate the original by the number of characters removed, or append random text (either other snippets of code elsewhere in the program, HTTP headers, or unrecognised characters) to the bottom of the file. For instance, in the IDE after a change is this:
While in firefox it is this (looks like some jquery code on the end):
Using FTP to transfer the files into the Guest OS works fine, however not shared folders. Also this problem is consistent, as I have tested with different browsers (firefox and chrome) and editors (phped, dreamweaver, notepad). Any suggestions as to how to rid myself of this problem?
Re: Issue with encoding and shared folders
Posted: 18. Jul 2009, 13:28
by vbox4me2
Try a real share, VBox SF don't behave the same as a real one.
Re: Issue with encoding and shared folders
Posted: 18. Jul 2009, 13:43
by Sasquatch
This is a common error when sharing files between Windows and Linux. Check the file character encoding that is used. Linux reads and presents files in UTF-8, but Windows saves the files by default with either ISO-8859-1/Latin-1 or Windows-1252. That difference can cause strange behaviour, especially when using characters like quotes and single quotes (' and "). So set your IDE to save the files with UTF-8 encoding.
Re: Issue with encoding and shared folders
Posted: 19. Jul 2009, 10:17
by Lobe
Thanks both of you for the help. I have tried using UTF-8 and various other types of encoding but with no success.
vbox4me2 wrote:Try a real share, VBox SF don't behave the same as a real one.
I'm not sure what you mean by this. Could you link to a guide?
Thanks,
Lobe
Re: Issue with encoding and shared folders
Posted: 19. Jul 2009, 11:37
by Sasquatch
Lobe wrote:Thanks both of you for the help. I have tried using UTF-8 and various other types of encoding but with no success.
vbox4me2 wrote:Try a real share, VBox SF don't behave the same as a real one.
I'm not sure what you mean by this. Could you link to a guide?
Thanks,
Lobe
A guide, like one to set up SAMBA on Linux. It's really easy, you only need the client, share the folder over the network with Windows and mount it in Linux. Easy as pie. Plenty to go around on the net.
Re: Issue with encoding and shared folders
Posted: 19. Jul 2009, 12:19
by Lobe
Sasquatch wrote:Lobe wrote:Thanks both of you for the help. I have tried using UTF-8 and various other types of encoding but with no success.
vbox4me2 wrote:Try a real share, VBox SF don't behave the same as a real one.
I'm not sure what you mean by this. Could you link to a guide?
Thanks,
Lobe
A guide, like one to set up SAMBA on Linux. It's really easy, you only need the client, share the folder over the network with Windows and mount it in Linux. Easy as pie. Plenty to go around on the net.
Thanks, I'll have a look around, try it later today and report back.
Re: Issue with encoding and shared folders
Posted: 20. Jul 2009, 03:32
by Lobe
Well, I tried, however getting the network share to be visible in Linux is proving troublesome. I have enabled file sharing on the folder that needs sharing, so that any computer attached to my home network can access the folder by viewing \\HOSTNAME\FOLDER, except the copy of ubuntu in Virtualbox. I am using the instructions
here.
When I type smbclient -L HOSTNAME -U USERNAME an error occurs:
Connection to HOSTNAME failed (Error NT_STATUS_BAD_NETWORK_NAME). I assume this means it couldn't find the share. Do I need to change the networking settings or such to access the share in a Guest OS? Sorry if I have done something blatantly noobish.
Re: Issue with encoding and shared folders
Posted: 20. Jul 2009, 04:43
by Lobe
Nevermind, problem solved. Turns out I had to use the host IP address rather than the hostname. Using a network share fixed the problem completely from what I have tried so far. Thanks a lot for helping me out, this has got to be the most annoying problem I have had computer-wise in the last few months, glad its solved.